revert unrelated changes

This commit is contained in:
Abhinav 2023-03-02 11:19:37 +05:30
parent 407bd9fd9a
commit b3ec5423a6
2 changed files with 22 additions and 36 deletions

View file

@ -87,7 +87,6 @@ class ExportService {
exportType: ExportType
) {
try {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
if (this.exportInProgress) {
this.electronAPIs.sendNotification(
ExportNotification.IN_PROGRESS

View file

@ -2,14 +2,12 @@ import * as Sentry from '@sentry/nextjs';
import { addLogLine } from 'utils/logging';
import { getSentryUserID } from 'utils/user';
export const logError = (
export const logError = async (
error: any,
msg: string,
info?: Record<string, unknown>,
skipAddLogLine = false
) => {
const main = async () => {
try {
if (isErrorUnnecessaryForSentry(error)) {
return;
}
@ -18,9 +16,7 @@ export const logError = (
addLogLine(
`error: ${error?.name} ${error?.message} ${
error?.stack
} msg: ${msg} ${
info ? `info: ${JSON.stringify(info)}` : ''
}`
} msg: ${msg} ${info ? `info: ${JSON.stringify(info)}` : ''}`
);
}
Sentry.captureException(err, {
@ -30,18 +26,9 @@ export const logError = (
...(info && {
info: info,
}),
rootCause: {
message: error?.message,
completeError: error,
},
rootCause: { message: error?.message, completeError: error },
},
});
} catch (e) {
addLogLine('error in logError', e);
// ignore
}
};
void main();
};
// copy of errorWithContext to prevent importing error util