Skip to content

Changed 'return HTTP...(detail=...)' to 'raise HTTP...(body=...)'

Sam Kagan requested to merge api-view-return-gripes into main

return -> raise will force the transaction manager to abort instead of committing when we want to exit a view with an exception response (https://docs.pylonsproject.org/projects/pyramid-tm/en/latest/#transaction-usage).

detail -> body will eliminate the boilerplate HTML that Pyramid uses for exception responses, meaning that the frontend can more easily display just the message we're sending.

Edited by Sam Kagan

Merge request reports