-
Notifications
You must be signed in to change notification settings - Fork 338
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
fix: api errors related to postage stamps #2037
Conversation
Sending PSS message with the postage bucket full may lead to similar issue (see #1988). @aloknerurkar do you plan to address that in this PR as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1, 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @acud, @AuHau, and @Eknir)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the jsonhttp.PaymentRequired
returns 402
, all the affected endpoint definitions in openapi/Swarm.yaml
should be also adjusted accordingly.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @acud, @AuHau, and @Eknir)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aloknerurkar, @AuHau, and @Eknir)
pkg/api/bzz.go, line 36 at r2 (raw file):
) func mappedHTTPErr(w http.ResponseWriter, e error, defaultMsg interface{}) {
i think that having such a pattern would be useful if all middlewares would just return an error to an upper layer middleware that would then translate the actual errors into a response. but since we don't do this I would vote for explicitly handling the errors within the handlers
pkg/api/bzz.go, line 36 at r2 (raw file): Previously, acud (acud) wrote…
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AuHau, @Eknir, and @mrekucci)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AuHau, @Eknir, and @mrekucci)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AuHau and @Eknir)
This PR attempts to solve #2026 in part.
This particular change tries to address the postage bucket full error which is annoying as the user does not understand that he cannot use the batch anymore.
We can create a separate
errors.go
file inpkg/api
which could house all these error case handlers. This way we can edit the same file from time to time to add special case handling.@acud @agazso @AuHau @Eknir
This change is