Skip to content

Commit

Permalink
(BSR)[API] refactor: create generic core exception for api errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lmaubert-pass committed Feb 12, 2025
1 parent 1224a82 commit 4c00f26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/src/pcapi/core/core_exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# generic core exception, inherited by all business errors raised in core modules
class CoreException(Exception):
def __init__(self, field: str, error: str):
super().__init__()
self.errors = {field: [error]}

0 comments on commit 4c00f26

Please sign in to comment.