mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +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,3 +1,4 @@
|
||||
import { ApplicationError } from '@/errors/application.error';
|
||||
import { jsonParse, jsonStringify, deepCopy, isObjectEmpty, fileTypeFromMimeType } from '@/utils';
|
||||
|
||||
describe('isObjectEmpty', () => {
|
||||
@@ -58,7 +59,11 @@ describe('isObjectEmpty', () => {
|
||||
const { calls } = keySpy.mock;
|
||||
|
||||
const assertCalls = (count: number) => {
|
||||
if (calls.length !== count) throw new Error(`Object.keys was called ${calls.length} times`);
|
||||
if (calls.length !== count) {
|
||||
throw new ApplicationError('`Object.keys()` was called an unexpected number of times', {
|
||||
extra: { times: calls.length },
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
assertCalls(0);
|
||||
|
||||
Reference in New Issue
Block a user