Skip to content

Commit

Permalink
reduce log level for 4xx errors (#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey800 authored Oct 9, 2023
1 parent ec73fd9 commit 39c6739
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/utils/HubAPIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ class HubAPIClient {
return data;
} catch (err) {
if (axios.isAxiosError(err)) {
logger.error({
const status = err.response?.status;
const level =
status !== undefined && status >= 400 && status < 500
? 'warn'
: 'error';

logger[level]({
message: 'Error sending request',
error: err.message,
method,
Expand Down

0 comments on commit 39c6739

Please sign in to comment.