mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
chore(core): Stop reporting TypeError and AttributeError from Python sandbox to Sentry (#12078)
This commit is contained in:
@@ -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 type { PyDict } from 'pyodide/ffi';
|
||||||
import { LoadPyodide } from './Pyodide';
|
import { LoadPyodide } from './Pyodide';
|
||||||
import type { SandboxContext } from './Sandbox';
|
import type { SandboxContext } from './Sandbox';
|
||||||
@@ -97,7 +97,9 @@ await __main()`;
|
|||||||
private getPrettyError(error: PyodideError): Error {
|
private getPrettyError(error: PyodideError): Error {
|
||||||
const errorTypeIndex = error.message.indexOf(error.type);
|
const errorTypeIndex = error.message.indexOf(error.type);
|
||||||
if (errorTypeIndex !== -1) {
|
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;
|
return error;
|
||||||
|
|||||||
Reference in New Issue
Block a user