Converting APIError to use SanicException as base.

This commit is contained in:
Roland 2024-05-01 17:42:26 -06:00
parent 58de8c7c5b
commit 9ee73af61d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
19 changed files with 181 additions and 161 deletions

View file

@ -5,17 +5,17 @@ from wrolpi.errors import APIError
class InvalidOTP(APIError):
code = 'INVALID_OTP'
summary = 'OTP has invalid characters'
status = HTTPStatus.BAD_REQUEST
message = 'OTP has invalid characters'
status_code = HTTPStatus.BAD_REQUEST
class InvalidPlaintext(APIError):
code = 'INVALID_PLAINTEXT'
summary = 'Plaintext has invalid characters'
status = HTTPStatus.BAD_REQUEST
message = 'Plaintext has invalid characters'
status_code = HTTPStatus.BAD_REQUEST
class InvalidCiphertext(APIError):
code = 'INVALID_CIPHERTEXT'
summary = 'Ciphertext has invalid characters'
status = HTTPStatus.BAD_REQUEST
message = 'Ciphertext has invalid characters'
status_code = HTTPStatus.BAD_REQUEST