-
Notifications
You must be signed in to change notification settings - Fork 37
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
Backend: handle null response from Eth server #287
Backend: handle null response from Eth server #287
Conversation
7f60c88
to
38605df
Compare
dd9edad
to
88e1be4
Compare
I've added null checks to other Eth requests. There are 2 places that already do null checks, but raise generic Should I also convert them to the new exception type? |
Yes |
88e1be4
to
13762be
Compare
When you say "In Eth code" you are defining a scope. We already have conventions in the way we write git commit messages to specify what part of the code you are modifying: it is the scope, the first part of the commit message title, before the colon. The scope can be more specific than the one you wrote, thanks to the fact that we also allow subscopes. So, replace |
c88f452
to
5e1c683
Compare
You ignored the sentence above. BTW let's add an additional final commit that refactors some stuff: when reviewing this diff I saw a couple of null checks that looked weird:
Let's replace both of those types (all occurrences) with isNull. |
7847a0d
to
ff16548
Compare
Let's rather make this PR target the stable branch. |
78e83d4
to
ced626f
Compare
rebased on |
Two last things to do here before I merge this:
|
Introduce AbnormalNullValueInJsonResponseException type and raise it when response for balance request for Ethereum returns json with "result" field value of `null`. This way server will be marked as faulty instead of crashing the application. Fixes nblockchain#282
Raise WeirdNullResponseException on all possible null responses or responses that contain null value from Ethereum servers.
Add code -39000 (UnparsableResponseType) to RpcErrorCode enum and process it since this error was encountered during integration testing.
Handle/retry HTTP error 408 (request timeout) in error handling code (raise ServerTimedOutException).
Make all null checks use isNull function as it's the most reliable way to test if value is null.
581097c
to
a012a4a
Compare
Introduce WeirdNullResponseException type and raise it when response for balance request for Ethereum returns json with "result" field value of
null
. This way server will be marked as faulty instead of crashing the application.Fixes #282