mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-08-09 11:16:03 +02:00
Merge pull request #140 from arvinnick/issue-138
caught the json exception and imitated another error which was above it
This commit is contained in:
@@ -2,6 +2,7 @@ import asyncio
|
|||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
from collections.abc import AsyncGenerator
|
from collections.abc import AsyncGenerator
|
||||||
|
from json import JSONDecodeError
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -75,6 +76,10 @@ async def process_prompt(
|
|||||||
logger.error(f"Request error: {exc}")
|
logger.error(f"Request error: {exc}")
|
||||||
errors.append((module_name, prompt, "?", str(exc)))
|
errors.append((module_name, prompt, "?", str(exc)))
|
||||||
return tokens, True
|
return tokens, True
|
||||||
|
except JSONDecodeError as json_decode_error:
|
||||||
|
logger.error(f"Jason error: {json_decode_error}")
|
||||||
|
errors.append((module_name, prompt, "?", str(json_decode_error)))
|
||||||
|
return tokens, True
|
||||||
|
|
||||||
|
|
||||||
async def perform_single_shot_scan(
|
async def perform_single_shot_scan(
|
||||||
|
|||||||
Reference in New Issue
Block a user