fix(knowledge): use EntityNotFoundError/DuplicateEntityError instead of DomainError(status_code=)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
This commit is contained in:
@@ -6,7 +6,7 @@ from uuid import UUID
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.domain.errors import DomainError
|
||||
from app.domain.errors import EntityNotFoundError
|
||||
from app.models.knowledge import LessonLearned
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ def _get_or_404(db: Session, ll_id: UUID) -> LessonLearned:
|
||||
LessonLearned.is_active == True,
|
||||
).first()
|
||||
if not ll:
|
||||
raise DomainError(f"Lesson Learned {ll_id} not found", status_code=404)
|
||||
raise EntityNotFoundError("LessonLearned", str(ll_id))
|
||||
return ll
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user