mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 22:19:41 -08:00
chore(core): Stop reporting TypeError
and AttributeError
from Python sandbox to Sentry (#12078)
This commit is contained in:
parent
891dd7f995
commit
aece4c497a
|
@ -1,4 +1,4 @@
|
|||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { ApplicationError, type IExecuteFunctions, type INodeExecutionData } from 'n8n-workflow';
|
||||
import type { PyDict } from 'pyodide/ffi';
|
||||
import { LoadPyodide } from './Pyodide';
|
||||
import type { SandboxContext } from './Sandbox';
|
||||
|
@ -97,7 +97,9 @@ await __main()`;
|
|||
private getPrettyError(error: PyodideError): Error {
|
||||
const errorTypeIndex = error.message.indexOf(error.type);
|
||||
if (errorTypeIndex !== -1) {
|
||||
return new Error(error.message.slice(errorTypeIndex));
|
||||
return new ApplicationError(error.message.slice(errorTypeIndex), {
|
||||
level: ['TypeError', 'AttributeError'].includes(error.type) ? 'warning' : 'error',
|
||||
});
|
||||
}
|
||||
|
||||
return error;
|
||||
|
|
Loading…
Reference in a new issue