Skip to content

Commit 0893752

Browse files
simone1999fselmo
authored andcommitted
Remove verbose RPC error logging:
- The error is already debug logged. If a user is handling `Web3RPCError`, they can still find debug logs of the error at the debug level. - The user_message is also available on the Web3RPCError class itself. No need to also error log it.
1 parent 46e4f3d commit 0893752

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

newsfragments/3546.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove error logging the user message on RPC errors. The user message is available on the exception and the response itself is logged at the debug level.

web3/manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ def _validate_response(
255255
web3_rpc_error = Web3RPCError(repr(error), rpc_response=response)
256256

257257
response = apply_error_formatters(error_formatters, response)
258-
259-
logger.error(web3_rpc_error.user_message)
260258
logger.debug(f"RPC error response: {response}")
259+
261260
raise web3_rpc_error
262261

263262
elif "result" not in response and not is_subscription_response:

0 commit comments

Comments
 (0)