mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Switch plain errors in workflow to ApplicationError (no-changelog) (#7877)
Ensure all errors in `workflow` are `ApplicationError` or children of it and contain no variables in the message, to continue normalizing all the errors we report to Sentry Follow-up to: https://github.com/n8n-io/n8n/pull/7873
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import FormData from 'form-data';
|
||||
import type { BinaryFileType, JsonObject } from './Interfaces';
|
||||
import { ApplicationError } from './errors/application.error';
|
||||
|
||||
const readStreamClasses = new Set(['ReadStream', 'Readable', 'ReadableStream']);
|
||||
|
||||
@@ -77,7 +78,7 @@ export const jsonParse = <T>(jsonString: string, options?: JSONParseOptions<T>):
|
||||
if (options?.fallbackValue !== undefined) {
|
||||
return options.fallbackValue;
|
||||
} else if (options?.errorMessage) {
|
||||
throw new Error(options.errorMessage);
|
||||
throw new ApplicationError(options.errorMessage);
|
||||
}
|
||||
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user