-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ipfs object get
with protobuf encoding never errors in HTTP API
#2468
Comments
Blocking ipfs-inactive/http-api-spec#67. |
Would it be acceptable to return a JSON error? |
Sure. But that needs to be returned. |
When `--encoding=protobuf` was set, `object get` used to always return a 200 response and would leave the body blank on error. Now, it returns a JSON error. fixes ipfs#2468 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
When `--encoding=protobuf` was set, `object get` used to always return a 200 response and would leave the body blank on error. Now, it returns a JSON error. fixes ipfs#2468 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
When `--encoding=protobuf` was set, `object get` used to always return a 200 response and would leave the body blank on error. Now, it returns a JSON error. fixes ipfs#2468 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
It should at least return a status code of |
We really shouldn't ever be returning 500 (500 means the application had some internal error it couldn't handle). Cases:
|
@Stebalien Fascinating! @whyrusleeping What do you think about this? Might be a wider-reaching issue. |
@Stebalien how much of this has been addressed by your latest PR? |
When `--encoding=protobuf` was set, `object get` used to always return a 200 response and would leave the body blank on error. Now, it returns a JSON error. fixes ipfs#2468 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
My PR only returns a 500 error (with json content) when |
So, this now does return a 500 error. It should probably return something else but that will require some changes to the API (we can revisit semantic errors later, right after we move away from the HTTP API to an RPC based API) . I'd call this specific issue fixed. |
Ok, so I think this is fixed. However, the error producing the 500 is actually a panic in the daemon so I'm going to wait for that issue to be fixed before declaring this fixed. |
ipfs object get --encoding=protobuf
works using the normal CLI:However, when put through the HTTP API, it will not return an error if the key is invalid or missing.
This should be solved before merging ipfs-inactive/http-api-spec#32.
The text was updated successfully, but these errors were encountered: