-
Notifications
You must be signed in to change notification settings - Fork 1k
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
display custom error details for injected web3 #4059
Conversation
✅ Deploy Preview for remixproject ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
471bdbe
to
0a9111c
Compare
@@ -173,3 +173,77 @@ export function checkVMError (execResult, compiledContracts) { | |||
ret.message = `${error}\n${exceptionError}\n${msg}\nDebug the transaction to get more information.` | |||
return ret | |||
} | |||
|
|||
export function checkInjectedError (errorObj, compiledContracts) { |
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.
could you check the function checkVMError
? could these be merged?
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.
done. Please check
eece268
to
5d3293a
Compare
@@ -57,7 +57,7 @@ export function callFunction (from, to, data, value, gasLimit, funAbi, txRunner, | |||
* @param {Object} execResult - execution result given by the VM |
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.
could you update the doc?
@@ -75,20 +75,20 @@ export function checkVMError (execResult, compiledContracts) { | |||
error: false, | |||
message: '' | |||
} | |||
if (!execResult.exceptionError) { | |||
if (!execResult.exceptionError && !isInjectedWeb3) { |
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.
seems like error
and returnData
are both the same but present under different properties... could you add a type execResult
, so you don't have to do stuff like isInjectedWeb3 ? execResult.error : exceptionError
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.
that way you may not need to have the isInjected
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.
I think execResult
is quite different for VM and injected Web3. For Injected web3, it is just an object having error details
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.
updated
8e55b44
to
058eb52
Compare
058eb52
to
c9f7d1f
Compare
fixes #3765