Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!tModule && relevantFrame) {
const fileName =
relevantFrame._originalFileName || relevantFrame.fileName || '';
tModule = manager.resolveTranspiledModule(
fileName.replace(location.origin, ''),
'/'
);
}
if (!tModule) {
return;
}
try {
const transformation = transformError(
errRef.error,
tModule,
manager.getTranspiledModules()
);
if (transformation) {
const newError = new Error(transformation.name || errRef.error.name);
newError.message = transformation.message;
newError.suggestions = transformation.suggestions;
newError.originalName = errRef.error.name;
newError.originalMessage = errRef.error.message;
errRef.error = newError;
}
} catch (ex) {
/* just catch */
console.error(ex);
if (!tModule && relevantFrame) {
const fileName =
relevantFrame._originalFileName || relevantFrame.fileName || '';
tModule = manager.resolveTranspiledModule(
fileName.replace(location.origin, ''),
'/'
);
}
if (!tModule) {
return;
}
try {
const transformation = transformError(
errRef.error,
tModule,
manager.getTranspiledModules()
);
if (transformation) {
errRef.error.originalName = errRef.error.name;
errRef.error.originalMessage = errRef.error.message;
errRef.error.name = transformation.name || errRef.error.name;
errRef.error.message = transformation.message;
errRef.error.suggestions = transformation.suggestions;
}
} catch (ex) {
/* just catch */
console.error(ex);