refactor: replace .error() with .exception() logging for better debugging on sentry

This commit is contained in:
Krrish Dholakia 2024-08-16 09:22:47 -07:00
parent 62365835f3
commit 2874b94fb1
35 changed files with 242 additions and 253 deletions

View file

@ -235,10 +235,8 @@ class BraintrustLogger(CustomLogger):
except httpx.HTTPStatusError as e:
raise Exception(e.response.text)
except Exception as e:
verbose_logger.error(
"Error logging to braintrust - Exception received - {}\n{}".format(
str(e), traceback.format_exc()
)
verbose_logger.exception(
"Error logging to braintrust - Exception received - {}".format(str(e))
)
raise e
@ -362,10 +360,8 @@ class BraintrustLogger(CustomLogger):
except httpx.HTTPStatusError as e:
raise Exception(e.response.text)
except Exception as e:
verbose_logger.error(
"Error logging to braintrust - Exception received - {}\n{}".format(
str(e), traceback.format_exc()
)
verbose_logger.exception(
"Error logging to braintrust - Exception received - {}".format(str(e))
)
raise e