-
Notifications
You must be signed in to change notification settings - Fork 36
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
Caller now can now pass error as string (old behavior) or dictionary #39
Caller now can now pass error as string (old behavior) or dictionary #39
Conversation
@@ -39974,7 +39974,7 @@ var AlphaWallet = { | |||
var callback = callbacks[id]; | |||
|
|||
if (callback.isRPC) { | |||
var response = { 'id': id, jsonrpc: '2.0', result: value, error: { message: error } }; | |||
var response = { 'id': id, jsonrpc: '2.0', result: value, error: error }; |
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.
@oa-s is it better to check error
if it's just a string and keep the old behavior?
if error is string //I forgot my JavaScript
error: { message: error }
else
error: error
end
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.
yes, looks good
@@ -39974,7 +39974,7 @@ var AlphaWallet = { | |||
var callback = callbacks[id]; | |||
|
|||
if (callback.isRPC) { | |||
var response = { 'id': id, jsonrpc: '2.0', result: value, error: { message: error } }; | |||
var response = { 'id': id, jsonrpc: '2.0', result: value, error: error }; |
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.
yes, looks good
…an now also pass a dictionary instead
e21ccf1
to
2a1121c
Compare
Force-pushed so the error passed to the callback can be a string (old behavior) as well as a dictionary |
Close #38