formatting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from flask import jsonify
|
||||
|
||||
|
||||
class ApiException(Exception):
|
||||
status_code = 500
|
||||
|
||||
@@ -13,10 +14,12 @@ class ApiException(Exception):
|
||||
rv.status_code = self.status_code
|
||||
return rv
|
||||
|
||||
|
||||
class NotFoundException(ApiException):
|
||||
def __init__(self, entity_name) -> None:
|
||||
super().__init__(404, f'{entity_name} could not be found')
|
||||
|
||||
|
||||
class BadRequestException(ApiException):
|
||||
def __init__(self, message) -> None:
|
||||
super().__init__(400, message)
|
||||
|
||||
Reference in New Issue
Block a user