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:
@@ -124,11 +124,8 @@ def get_playbook_by_technique_type(
|
||||
):
|
||||
pb = pb_svc.get_playbook_by_technique_type(db, technique_id, playbook_type)
|
||||
if not pb:
|
||||
from app.domain.errors import DomainError
|
||||
raise DomainError(
|
||||
f"No '{playbook_type}' playbook for technique {technique_id}",
|
||||
status_code=404,
|
||||
)
|
||||
from app.domain.errors import EntityNotFoundError
|
||||
raise EntityNotFoundError("Playbook", f"{technique_id}/{playbook_type}")
|
||||
return pb
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user