WIPACrepo / file_catalog

Store file metadata information in a file catalog
MIT License
1 stars 4 forks source link

Replace `write_error`-`return` with `raise`-`HTTPError` Syntax #111

Closed ric-evans closed 1 year ago

ric-evans commented 2 years ago

remembering to return after writing the error is prone to create bugs, especially when the writing is nested in a call stack.

Instead, simply raise HTTPError. Some refactoring will be needed for validation/deconfliction methods that return bools.

dsschult commented 2 years ago

Example:

raise HTTPError(403, reason="authentication failed")