[TM-321] Add error types
Description
Problem: we should explicitly state how each error should be handled by middleware/client like web application associate different HTTP codes to their errors.
Solution: introduce 3 types of errors - "action exception", "internal
error" and "bad argument". Let developers specify them in
CustomErrHasDoc
typeclass; by default use "action exception".
Note from MR author: since there is a default value for
errDocClass
, I'm afraid that it becomes too easy to forget to specify
class when necessary, and then documentation would state wrong
information.
I propose to either remove default value, or use some unknown type
by
default.
Related issue(s)
https://issues.serokell.io/issue/TM-321
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Konstantin Ivanov