-
Notifications
You must be signed in to change notification settings - Fork 92
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
For http requests, return the original response to the caller, not just 400 #169
Comments
The code at https://github.com/bigchaindb/js-bigchaindb-driver/blob/master/src/baseRequest.js#L47 creates a new error object. Instead it should either throw the existing object directly, or add it to the throwing object as below:
or, else:
This is really biting hard in the development, since we are almost blind as to why the server is not accepting the post transaction, and we have to manually check the post body externally every time there is a failure, which is very tedious. |
Currently the calls to requests, such as
postTransactionCommit(createTranfer)
, when error happens, the driver returns an error that just includes blanket 400 response, which is not useful.In many cases, the server, even though it returns a status code of 400, it also returns a valid response body that will have much more meaningful information to the caller, which is not being supplied to the caller.
Instead of returning blanket 400 to the caller, return the original response also to the caller so that they can either log it or display it to the user.
Expected: the values sent to the promise catch handler should include detailed server response, and not just explanation of 400
The text was updated successfully, but these errors were encountered: