mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-20 03:36:25 +00:00
Use WebError, not RuntimeError, to indicate error
Several problems with using RuntimeError to signal error here: - It dumps a rather unhelpful webpage at the user. - The exception backtrace on Tahoe console is not quite necessary here. - It really is not a runtime error: it is just an expected failure. - But mainly, testing for RuntimeError is harder.
This commit is contained in:
parent
f9e864c51c
commit
54248f334e
@ -25,6 +25,7 @@ from allmydata.web.common import (
|
||||
render_time,
|
||||
MultiFormatResource,
|
||||
SlotsSequenceElement,
|
||||
WebError,
|
||||
)
|
||||
|
||||
from allmydata.interfaces import (
|
||||
@ -1171,9 +1172,7 @@ class Status(MultiFormatResource):
|
||||
try:
|
||||
stype, count_s = path.split("-")
|
||||
except ValueError:
|
||||
raise RuntimeError(
|
||||
"no - in '{}'".format(path)
|
||||
)
|
||||
raise WebError("no '-' in '{}'".format(path))
|
||||
count = int(count_s)
|
||||
if stype == "up":
|
||||
for s in itertools.chain(h.list_all_upload_statuses(),
|
||||
|
Loading…
Reference in New Issue
Block a user