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 exportType: ExportType
) { ) {
try { try {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
if (this.exportInProgress) { if (this.exportInProgress) {
this.electronAPIs.sendNotification( this.electronAPIs.sendNotification(
ExportNotification.IN_PROGRESS ExportNotification.IN_PROGRESS

View file

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