Skip to content

Commit 5cdbf93

Browse files
committed
fix(handling InvalidHTTPSpecError):
1 parent 54d159a commit 5cdbf93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

agentic_security/routes/scan.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from ..core.app import get_stop_event, get_tools_inbox, set_current_run
1919
from ..dependencies import InMemorySecrets, get_in_memory_secrets
20-
from ..http_spec import LLMSpec
20+
from ..http_spec import InvalidHTTPSpecError, LLMSpec
2121
from ..primitives import LLMInfo, Scan
2222
from ..probe_actor import fuzzer
2323

@@ -31,6 +31,8 @@ async def verify(
3131
spec = LLMSpec.from_string(info.spec)
3232
try:
3333
r = await spec.verify()
34+
except InvalidHTTPSpecError as e:
35+
raise HTTPException(status_code=400, detail=str(e))
3436
except Exception as e:
3537
logger.exception(e)
3638
raise HTTPException(status_code=400, detail=str(e))

0 commit comments

Comments
 (0)