Closed
Description
Currently we're raising an InvalidParamsError or ApiError to return a failure response.
@method
def fruits(color):
if color not in ("red", "orange", "yellow"):
raise InvalidParamsError("No fruits of that colour")
I would prefer not to raise an exception for these, because it
- uses exceptions to control flow
- makes the @method a partial function
- goes against the functional style of the rest of the library
Instead we should return
an error response.
Metadata
Metadata
Assignees
Labels
No labels