mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Switch plain errors in nodes-base to ApplicationError (no-changelog) (#7914)
Ensure all errors in `nodes-base` are `ApplicationError` or children of it and contain no variables in the message, to continue normalizing all the backend errors we report to Sentry. Also, skip reporting to Sentry errors from user input and from external APIs. In future we should refine `ApplicationError` to more specific errors. Follow-up to: [#7877](https://github.com/n8n-io/n8n/pull/7877) - [x] Test workflows: https://github.com/n8n-io/n8n/actions/runs/7084627970 - [x] e2e: https://github.com/n8n-io/n8n/actions/runs/7084936861 --------- Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IWebhookFunctions,
|
||||
import {
|
||||
ApplicationError,
|
||||
type IDataObject,
|
||||
type IExecuteFunctions,
|
||||
type IHookFunctions,
|
||||
type ILoadOptionsFunctions,
|
||||
type IWebhookFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import { BASE_URL } from './constants';
|
||||
|
||||
@@ -43,7 +44,10 @@ export async function lonescaleApiRequest(
|
||||
if (error.response) {
|
||||
const errorMessage =
|
||||
error.response.body.message || error.response.body.description || error.message;
|
||||
throw new Error(`Autopilot error response [${error.statusCode}]: ${errorMessage}`);
|
||||
throw new ApplicationError(
|
||||
`Autopilot error response [${error.statusCode}]: ${errorMessage}`,
|
||||
{ level: 'warning' },
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user