minor: global exception names
This commit is contained in:
parent
4a97789c1a
commit
da5099e172
3 changed files with 9 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ from fastapi import APIRouter, status
|
|||
from psycopg.errors import UniqueViolation
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from src.exceptions import Conflict
|
||||
from src.exceptions import ConflictException
|
||||
from src.database import db_dependency
|
||||
from src.auth.dependencies import super_admin_dependency, org_model_root_claim_query_dependency
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ async def register_service(db: db_dependency, su: super_admin_dependency, reques
|
|||
db.flush()
|
||||
except IntegrityError as e:
|
||||
if isinstance(e.orig, UniqueViolation):
|
||||
raise Conflict(message="Service with this name already exists")
|
||||
raise ConflictException(message="Service with this name already exists")
|
||||
db.commit()
|
||||
response = ServiceWithKeySchema(**service_model.__dict__)
|
||||
db.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue