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

Pinning - Refactoring errors into api/errors.js #741

Closed
mbommerez opened this issue Dec 2, 2021 · 0 comments · Fixed by #937
Closed

Pinning - Refactoring errors into api/errors.js #741

mbommerez opened this issue Dec 2, 2021 · 0 comments · Fixed by #937
Assignees
Labels
topic/pot Issues handled by PT.

Comments

@mbommerez
Copy link

mbommerez commented Dec 2, 2021

Raise errors in APIs instead of creating different JsonResponses within the endpoint logic.

As part of this, we should also be updating how we validate payload data for the endpoint.
The way we do validation now is really imperative, we should look at a better, more declarative way to do it.
NftStorage uses @cfworker/json-schema, it seems like what we're looking for, and also would help keeping consistency with NFT.storage.

Yes, we have a /api/errors.js file where this should live. We will also be adding better debuggability with logtail and it would be good to centralize everything there.

#726 (comment)
#726 (comment)

@flea89 flea89 mentioned this issue Dec 17, 2021
@GaryHomewood GaryHomewood self-assigned this Jan 11, 2022
@mbommerez mbommerez added the topic/pot Issues handled by PT. label Jan 20, 2022
@alexandrastoica alexandrastoica linked a pull request Feb 3, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/pot Issues handled by PT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants