-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: propagate data.cause as cause in JsonRpcError constructor #140
Conversation
88f1100
to
d4f192d
Compare
d4f192d
to
e6350af
Compare
74a6837
to
4b265fd
Compare
- break out util function dataHasCause with test - comment clarity - use native causes when available note: jest coverage depends on runtime
4b265fd
to
09d433a
Compare
Validated locally that tests also pass on Node.js v14, which definitely doesn't have support for causes. We also see the expected increase in jest coverage, there. |
Updated with some improvements lifted over from #141 :
This branch has been published for evaluation as |
functions: 94.44, | ||
lines: 92.85, | ||
statements: 92.85, | ||
branches: 91.89, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
If any reviewers are still looking at this: Pending review in #144 so follow-ups are still NBD, if you see any room for improvement. |
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
This maps the tc39 error
cause
field onJsonRpcError
instances todata.cause
, if it exists and is an object. No further validation is performed.This is done because adding
es2022
ordom
to tsconfig lib are not being considered at this point.Related
Alternative