Skip to content

feat: use pyramid decorators and rework error handling

Arnaud Vergnet requested to merge topic/default/architecture_rework into branch/default

Completely rewrites route creation to use pyramid decorators instead of contexes.

Also reworks the error handling to make it easier to choose what errors to catch and when. It now uses regular try...except blocks around the parts which could fail, and raises a pyramid HTTPError to return an HTTP error to the user.

As part of the error handling, this MR adds request parameter validation using marshmallow and marshmallow_dataclass. Using those libraries we can define dataclasses and convert them to a schema compatible with marshmallow and used to validate request parameters.

There is one breaking change in this MR: The /transaction endpoint is now split in 4 with /transaction/begin, /transaction/execute, /transaction/commit and /transaction/rollback. This was done in order to have static params. Before this change, request parameters would change based on the action param.

Closes #9 (closed)

Closes #5 (closed)

Closes #11 (closed)

Edited by Arnaud Vergnet

Merge request reports