fix(knowledge): use EntityNotFoundError/DuplicateEntityError instead of DomainError(status_code=)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

This commit is contained in:
kitos
2026-05-20 15:21:36 +02:00
parent 9546ef8bc8
commit 4fba4152d9
3 changed files with 14 additions and 17 deletions

View File

@@ -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