We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I have been searching for a way to extract the code and message out from the error.
For example:- Error: Error(code: -32000, message: "insufficient funds for gas * price + value")
Error: Error(code: -32000, message: "insufficient funds for gas * price + value")
How can I get the Code and the Message?
The text was updated successfully, but these errors were encountered:
If you have an instance of error you could do something like that:
if let error = error as? RPCResponse<EthereumData>.Error { print(error.code) print(error.message) }
Sorry, something went wrong.
Having to provide the generic type for RPCResponse on your own is really not great. I think we should change the Error to a non-subtype.
Btw, my example is only possible with version 0.3.1 which was released just today...
I tested. It worked great! Thanks @Ybrin !
No branches or pull requests
Hi,
I have been searching for a way to extract the code and message out from the error.
For example:-
Error: Error(code: -32000, message: "insufficient funds for gas * price + value")
How can I get the Code and the Message?
The text was updated successfully, but these errors were encountered: