Skip to content
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

Provide sentinel errors in the HTTP API #7307

Open
sanderpick opened this issue May 12, 2020 · 3 comments
Open

Provide sentinel errors in the HTTP API #7307

sanderpick opened this issue May 12, 2020 · 3 comments
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked topic/rpc-api Issues related to Kubo RPC API at /api/v0

Comments

@sanderpick
Copy link
Contributor

Matching errors against concrete types would be nice vs. fragile error string matching, e.g.,

if err.Error() == "'from' cid was not recursively pinned already" { ...

Or, maybe using more fine grained error codes would be even better. I believe the above error will come with a code: ErrNormal or similar.

@welcome

This comment has been minimized.

@Stebalien
Copy link
Member

At the moment, our error codes are mostly concerned with transport level errors:

  • ErrNormal - normal error.
  • ErrClient - client passed an invalid input.
  • ErrImplementation - bug.

We could definitely extend these with additional well-known error codes. That is:

  • Errors 0-100: generic errors.
  • Errors 100+: other errors.

@Stebalien Stebalien transferred this issue from ipfs/go-ipfs-http-client May 12, 2020
@Stebalien Stebalien changed the title Provide sentinel errors Provide sentinel errors in the HTTP API May 12, 2020
@ipfs ipfs deleted a comment from welcome bot May 12, 2020
@Stebalien Stebalien added kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now topic/rpc-api Issues related to Kubo RPC API at /api/v0 help wanted Seeking public contribution on this issue labels May 12, 2020
@sanderpick
Copy link
Contributor Author

Sounds good, that would be quite nice!

@aschmahmann aschmahmann added the status/ready Ready to be worked label Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked topic/rpc-api Issues related to Kubo RPC API at /api/v0
Projects
None yet
Development

No branches or pull requests

3 participants