Skip to content

Commit cb89a45

Browse files
authored
Catch any json deserializer exception (#174)
1 parent 709b445 commit cb89a45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jsonrpcserver/dispatcher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ def dispatch_to_response_pure(
182182
try:
183183
try:
184184
deserialized = deserializer(request)
185-
except json.JSONDecodeError as exc:
185+
# We don't know which deserializer will be used, so the specific exception that
186+
# will be raised is unknown. Any exception is a parse error.
187+
except Exception as exc:
186188
return ParseErrorResponse(str(exc))
187189
try:
188190
validate(deserialized)

0 commit comments

Comments
 (0)