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

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
sajith added the
unknown
normal
defect
n/a
labels 2020-09-17 20:59:54 +00:00
sajith added this to the undecided milestone 2020-09-17 20:59:54 +00:00
sajith added
code-frontend-web
and removed
unknown
labels 2020-09-17 21:00:21 +00:00
sajith modified the milestone from undecided to Support Python 3 2020-09-17 21:00:21 +00:00
sajith self-assigned this 2020-09-17 21:00:21 +00:00

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).

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.

Ticket retargeted after milestone closed

Ticket retargeted after milestone closed
itamarst 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 Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

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