Skip to content

Commit 05c60fc

Browse files
committed
🔇 remove debug logs and fix axios bug
1 parent 99b4136 commit 05c60fc

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/util/error.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ export const throwAndDelegateError = (
1212
apiKey: string | undefined,
1313
logMessage?: string
1414
) => {
15-
const errorMessage =
16-
error instanceof AxiosError
17-
? error.response?.data
18-
? JSON.stringify(error.response?.data)
19-
: error.message
20-
: error.message;
15+
const errorMessage = axios.isAxiosError(error)
16+
? error.response?.data
17+
? JSON.stringify(error.response?.data)
18+
: error.message
19+
: error.message;
2120

2221
if (logMessage) {
2322
errorLogger(source, logMessage, apiKey, errorMessage);
@@ -43,12 +42,9 @@ export const throwAndDelegateError = (
4342
errorType = IntegrationErrorType.INTEGRATION_ERROR_UNAVAILABLE;
4443
break;
4544
default:
46-
console.log("bin default weil status= ", status);
4745
throw new ServerError(status, `${source} (${errorMessage})`);
4846
}
49-
console.log("bin außerhalb vom switch weil status= ", status);
5047
throw new ServerError(DELEGATE_TO_FRONTEND_CODE, errorType);
5148
}
52-
console.log("kein axios");
5349
throw new ServerError(500, "An internal error occurred");
5450
};

0 commit comments

Comments
 (0)