Merge pull request #561 from ente-io/fix-ffmpeg-regression

fix window is undefined in ffmpeg worker error
This commit is contained in:
Vishnu Mohandas 2022-05-25 12:19:52 +05:30 committed by GitHub
commit 49ce07ffc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -108,6 +108,7 @@ export function errorWithContext(originalError: Error, context: string) {
originalError.stack;
return errorWithContext;
}
export const parseSharingErrorCodes = (error) => {
let parsedMessage = null;
if (error?.status) {

View file

@ -1,5 +1,4 @@
import * as Sentry from '@sentry/nextjs';
import { errorWithContext } from 'utils/error';
import { getUserAnonymizedID } from 'utils/user';
export const logError = (
@ -22,3 +21,13 @@ export const logError = (
},
});
};
// copy of errorWithContext to prevent importing error util
function errorWithContext(originalError: Error, context: string) {
const errorWithContext = new Error(context);
errorWithContext.stack =
errorWithContext.stack.split('\n').slice(2, 4).join('\n') +
'\n' +
originalError.stack;
return errorWithContext;
}