only log tracebacks for api errors not defined in lbry.error
This commit is contained in:
parent
2445c00c7e
commit
d07685f0e9
1 changed files with 5 additions and 2 deletions
|
@ -36,7 +36,7 @@ from lbry.blob_exchange.downloader import download_blob
|
|||
from lbry.dht.peer import make_kademlia_peer
|
||||
from lbry.error import (
|
||||
DownloadSDTimeoutError, ComponentsNotStartedError, ComponentStartConditionNotMetError,
|
||||
CommandDoesNotExistError
|
||||
CommandDoesNotExistError, BaseError
|
||||
)
|
||||
from lbry.extras import system_info
|
||||
from lbry.extras.daemon import analytics
|
||||
|
@ -702,7 +702,10 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
raise
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
self.failed_request_metric.labels(method=function_name).inc()
|
||||
log.exception("error handling api request")
|
||||
if not isinstance(e, BaseError):
|
||||
log.exception("error handling api request")
|
||||
else:
|
||||
log.error("error handling api request: %s", e)
|
||||
return JSONRPCError.create_command_exception(
|
||||
command=function_name, args=_args, kwargs=_kwargs, exception=e, traceback=format_exc()
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue