mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-09-30 11:51:46 +02:00
fix(handling InvalidHTTPSpecError):
This commit is contained in:
1 parent
54d159a737
commit
5cdbf933de
1 file changed
+3
-1
@@ -17,7 +17,7 @@ from agentic_security.logutils import logger
|
|||||||
|
|
||||||
from ..core.app import get_stop_event, get_tools_inbox, set_current_run
|
from ..core.app import get_stop_event, get_tools_inbox, set_current_run
|
||||||
from ..dependencies import InMemorySecrets, get_in_memory_secrets
|
from ..dependencies import InMemorySecrets, get_in_memory_secrets
|
||||||
from ..http_spec import LLMSpec
|
from ..http_spec import InvalidHTTPSpecError, LLMSpec
|
||||||
from ..primitives import LLMInfo, Scan
|
from ..primitives import LLMInfo, Scan
|
||||||
from ..probe_actor import fuzzer
|
from ..probe_actor import fuzzer
|
||||||
|
|
||||||
@@ -31,6 +31,8 @@ async def verify(
|
|||||||
spec = LLMSpec.from_string(info.spec)
|
spec = LLMSpec.from_string(info.spec)
|
||||||
try:
|
try:
|
||||||
r = await spec.verify()
|
r = await spec.verify()
|
||||||
|
except InvalidHTTPSpecError as e:
|
||||||
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|||||||
Reference in new issue
Block a user