Twisted web Resources should "return ErrorPage" instead of "raise WebError" #3420

Open
opened 2020-09-17 20:59:54 +00:00 by sajith · 3 comments
sajith commented 2020-09-17 20:59:54 +00:00
Owner

In case of errors, twisted.web Resource instances should be responding with an error page, instead of throwing an exception. Any raise [WebError](wiki/WebError) instances we have in Tahoe WUI should be replaced with return [ErrorPage](wiki/ErrorPage).

More background is in this discussion at GitHub about a PR that solves #3382.

Sub-tickets:

  • #3422 - allmydata/web/directory.py should return error pages instead of raising WebError
  • #3423 - allmydata/web/filenode.py should return error pages instead of raising WebError
  • #3424 - allmydata/web/operations.py should return error pages instead of raising WebError
  • #3425 - allmydata/web/root.py should return error pages instead of raising WebError
  • #3426 - allmydata/web/status.py should return error pages instead of raising WebError
  • #3427 - allmydata/web/unlinked.py should return error pages instead of raising WebError
  • #3429 - allmydata/web/check_result.py should return error pages instead of raising WebError
In case of errors, twisted.web `Resource` instances should be responding with an error page, instead of throwing an exception. Any `raise [WebError](wiki/WebError)` instances we have in Tahoe WUI should be replaced with `return [ErrorPage](wiki/ErrorPage)`. More background is in [this discussion](https://github.com/tahoe-lafs/tahoe-lafs/pull/781) at GitHub about a PR that solves #3382. Sub-tickets: - #3422 - allmydata/web/directory.py should return error pages instead of raising WebError - #3423 - allmydata/web/filenode.py should return error pages instead of raising WebError - #3424 - allmydata/web/operations.py should return error pages instead of raising WebError - #3425 - allmydata/web/root.py should return error pages instead of raising WebError - #3426 - allmydata/web/status.py should return error pages instead of raising WebError - #3427 - allmydata/web/unlinked.py should return error pages instead of raising WebError - #3429 - allmydata/web/check_result.py should return error pages instead of raising WebError
tahoe-lafs added the
unknown
normal
defect
n/a
labels 2020-09-17 20:59:54 +00:00
tahoe-lafs added this to the undecided milestone 2020-09-17 20:59:54 +00:00
tahoe-lafs added
code-frontend-web
and removed
unknown
labels 2020-09-17 21:00:21 +00:00
tahoe-lafs modified the milestone from undecided to Support Python 3 2020-09-17 21:00:21 +00:00
exarkun commented 2020-09-18 17:59:01 +00:00
Author
Owner

This is probably worth splitting up. The changes will be spread out across a lot of the web code and have little overlap (apart from a few shared error page helpers that will come pretty early, I suspect).

This is probably worth splitting up. The changes will be spread out across a lot of the web code and have little overlap (apart from a few shared error page helpers that will come pretty early, I suspect).
exarkun commented 2020-10-20 18:20:28 +00:00
Author
Owner

This is somewhat mitigated by the work for ticket:3422 which introduced the @render_exception decorator which will transform an exception into an ErrorPage.

This may still be a sensible change to make but we don't need it to fully escape Nevow at this point.

Though all the currently linked sub-tickets are resolved there are still some parts of the web code that do raise WebError. I think we just didn't get around to filing tickets for them.

This is somewhat mitigated by the work for ticket:3422 which introduced the `@render_exception` decorator which will transform an exception into an [ErrorPage](wiki/ErrorPage). This may still be a sensible change to make but we don't need it to fully escape Nevow at this point. Though all the currently linked sub-tickets are resolved there are still some parts of the web code that do raise `WebError`. I think we just didn't get around to filing tickets for them.
itamarst commented 2023-09-05 14:20:22 +00:00
Author
Owner

Ticket retargeted after milestone closed

Ticket retargeted after milestone closed
tahoe-lafs removed this from the Support Python 3 milestone 2023-09-05 14:20:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#3420
No description provided.