Skip to content

Commit b152e78

Browse files
committed
caught the json exception and imitated another error which was above it
1 parent 7e458db commit b152e78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

agentic_security/probe_actor/fuzzer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import random
33
import time
44
from collections.abc import AsyncGenerator
5+
from json import JSONDecodeError
56

67
import httpx
78
import pandas as pd
@@ -75,6 +76,10 @@ async def process_prompt(
7576
logger.error(f"Request error: {exc}")
7677
errors.append((module_name, prompt, "?", str(exc)))
7778
return tokens, True
79+
except JSONDecodeError as json_decode_error:
80+
logger.error(f"Jason error: {json_decode_error}")
81+
errors.append((module_name, prompt, "?", str(json_decode_error)))
82+
return tokens, True
7883

7984

8085
async def perform_single_shot_scan(

0 commit comments

Comments
 (0)