Skip to content

Commit 93d451e

Browse files
committed
Fixed ignore errors hopefully
1 parent 791d525 commit 93d451e

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

backend/PyMatcha/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,14 @@ def expired_token_callback(expired_token):
184184
logging.debug("Configuring JWT user callback loader")
185185

186186

187-
from PyMatcha.utils.errors import NotFoundError, BadRequestError, ConflictError, UnauthorizedError, ForbiddenError
187+
from PyMatcha.utils.errors import NotFoundError
188+
from PyMatcha.utils.errors.base_class import CustomException
188189

189190

190191
def before_send(event, hint):
191192
if "exc_info" in hint:
192193
exc_type, exc_value, tb = hint["exc_info"]
193-
if isinstance(exc_value, (NotFoundError, BadRequestError, ConflictError, UnauthorizedError, ForbiddenError)):
194+
if issubclass(exc_value, CustomException):
194195
return None
195196
return event
196197

backend/PyMatcha/utils/errors/badrequest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
"""
1919
from PyMatcha import application
20+
from PyMatcha.utils.errors.base_class import CustomException
2021
from PyMatcha.utils.errors.template import generate_error_json
2122

2223

23-
class BadRequestError(Exception):
24+
class BadRequestError(CustomException):
2425
"""
2526
This is the BadRequestError class for the Exception.
2627
"""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class CustomException(Exception):
2+
pass

backend/PyMatcha/utils/errors/conflict.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
"""
1919
from PyMatcha import application
20+
from PyMatcha.utils.errors.base_class import CustomException
2021
from PyMatcha.utils.errors.template import generate_error_json
2122

2223

23-
class ConflictError(Exception):
24+
class ConflictError(CustomException):
2425
"""
2526
This is the ConflictError class for the Exception.
2627
"""

backend/PyMatcha/utils/errors/forbidden.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
"""
1919
from PyMatcha import application
20+
from PyMatcha.utils.errors.base_class import CustomException
2021
from PyMatcha.utils.errors.template import generate_error_json
2122

2223

23-
class ForbiddenError(Exception):
24+
class ForbiddenError(CustomException):
2425
"""
2526
This is the ForbiddenError class for the Exception.
2627
"""

backend/PyMatcha/utils/errors/notfound.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
"""
1919
from PyMatcha import application
20+
from PyMatcha.utils.errors.base_class import CustomException
2021
from PyMatcha.utils.errors.template import generate_error_json
2122

2223

23-
class NotFoundError(Exception):
24+
class NotFoundError(CustomException):
2425
"""
2526
This is the NotFoundError class for the Exception.
2627
"""

backend/PyMatcha/utils/errors/unauthorized.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
"""
1919
from PyMatcha import application
20+
from PyMatcha.utils.errors.base_class import CustomException
2021
from PyMatcha.utils.errors.template import generate_error_json
2122

2223

23-
class UnauthorizedError(Exception):
24+
class UnauthorizedError(CustomException):
2425
"""
2526
This is the UnauthorizedError class for the Exception.
2627
"""

0 commit comments

Comments
 (0)