refactor(core): Switch plain errors in core to ApplicationError (no-changelog) (#7873)

Ensure all errors in `core` 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/7857
This commit is contained in:
Iván Ovejero
2023-11-30 09:06:19 +01:00
committed by GitHub
parent cd474f1562
commit b16dd21909
10 changed files with 135 additions and 101 deletions

View File

@@ -5,7 +5,7 @@ import axios from 'axios';
import { Service } from 'typedi';
import { sign } from 'aws4';
import { isStream, parseXml, writeBlockedMessage } from './utils';
import { LoggerProxy as Logger } from 'n8n-workflow';
import { ApplicationError, LoggerProxy as Logger } from 'n8n-workflow';
import type { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
import type { Request as Aws4Options, Credentials as Aws4Credentials } from 'aws4';
@@ -283,7 +283,7 @@ export class ObjectStoreService {
this.logger.error(message, { config });
throw new Error(message, { cause: { error, details: config } });
throw new ApplicationError(message, { cause: error, extra: { config } });
}
}
}