refactor(core): Stop reporting to Sentry NodeApiError outside 500 range (no-changelog) (#7753)

https://n8nio.sentry.io/issues/4312838883 (and many others)

Followup to https://github.com/n8n-io/n8n/pull/7662
This commit is contained in:
Iván Ovejero 2023-11-17 17:49:28 +01:00 committed by GitHub
parent 6be453b716
commit 0fda8d9aac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -357,9 +357,6 @@ export class NodeApiError extends NodeError {
) {
super(node, error);
if (severity) this.severity = severity;
else if (httpCode?.charAt(0) !== '5') this.severity = 'warning';
// only for request library error
if (error.error) {
removeCircularRefs(error.error as JsonObject);
@ -401,6 +398,12 @@ export class NodeApiError extends NodeError {
this.findProperty(error, ERROR_STATUS_PROPERTIES, ERROR_NESTING_PROPERTIES) ?? null;
}
if (severity) {
this.severity = severity;
} else if (this.httpCode?.charAt(0) !== '5') {
this.severity = 'warning';
}
// set description of this error
if (description) {
this.description = description;