Open sobolevn opened 5 years ago
I have troubles in creating a declarative error handling. But, thanks to hanami authors that there's a nice concept in their framework: https://guides.hanamirb.org/actions/exception-handling/
hanami
So, how should this be solved?
class UserListMethod(BodylessMethod): exceptions = { TypeError: Error(status=403, message='User is an alien!'), AttributeError: 403, SomeCustomError: callable, # type: Callable[[request, request_payload, exception], Error] } ...
I have troubles in creating a declarative error handling. But, thanks to
hanami
authors that there's a nice concept in their framework: https://guides.hanamirb.org/actions/exception-handling/So, how should this be solved?