Skip to content

Commit

Permalink
common: reduce jrpc exception spam
Browse files Browse the repository at this point in the history
When a client repeatedly makes a request that results in an error
the log is spammed with tracebacks that don't provide significant
value.  The method name, code, and error message should be
enough for basic troubleshooting.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
  • Loading branch information
Arksine committed Jul 9, 2023
1 parent d51820f commit 504a3a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moonraker/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ def build_error(
) -> Dict[str, Any]:
if method_name:
method_name = f"Requested Method: {method_name}, "
log_msg = f"JSON-RPC Request Error - {method_name}Code: {code}\n{msg}"
if is_exc:
log_msg = f"JSON-RPC Request Error - {method_name}Code: {code}, Message: {msg}"
if is_exc and self.verbose:
logging.exception(log_msg)
else:
logging.info(log_msg)
Expand Down

0 comments on commit 504a3a7

Please sign in to comment.