Skip to content

Commit

Permalink
fix debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-yeager committed Jan 14, 2025
1 parent 476f4da commit b03f01e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/errorHandlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import { shouldSuppressError } from './suppressError';
import { i18n } from '../lang';
import util from 'util';
import { isAxiosError } from 'axios';

const i18nKey = 'lib.errorHandlers.index';

Expand Down Expand Up @@ -50,10 +51,12 @@ export function debugError(error: unknown, context?: ApiErrorContext): void {
logger.debug(i18n(`${i18nKey}.errorOccurred`, { error: String(error) }));
}

if (error instanceof Error) {
if (error instanceof Error && error.cause) {
logger.debug(
i18n(`${i18nKey}.errorCause`, {
cause: util.inspect(error.cause, false, null, true),
cause: isAxiosError(error.cause)
? `${error.cause}`
: util.inspect(error.cause, false, null, true),
})
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/projects/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export async function handleProjectUpload<T = ProjectUploadDefaultResult>(
);

if (error) {
console.log(error);
uploadResult = { uploadError: error };
} else if (callbackFunc) {
uploadResult = await callbackFunc(
Expand Down

0 comments on commit b03f01e

Please sign in to comment.