fix(core): Ensure AxiosError status always gets copied over to NodeApiError (#8509)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-02-02 12:22:26 +01:00 committed by GitHub
parent 4fed68ee34
commit 76c5a62f52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View file

@ -51,6 +51,7 @@
"@n8n/tournament": "1.0.2",
"@n8n_io/riot-tmpl": "4.0.0",
"ast-types": "0.15.2",
"axios": "1.6.7",
"callsites": "3.1.0",
"deep-equal": "2.2.0",
"esprima-next": "5.8.4",

View file

@ -14,6 +14,7 @@ import type {
import { NodeError } from './abstract/node.error';
import { removeCircularRefs } from '../utils';
import type { ReportingOptions } from './application.error';
import { AxiosError } from 'axios';
export interface NodeOperationErrorOptions {
message?: string;
@ -127,6 +128,10 @@ export class NodeApiError extends NodeError {
) {
super(node, errorResponse);
if (!httpCode && errorResponse instanceof AxiosError) {
httpCode = errorResponse.response?.status?.toString();
}
// only for request library error
if (errorResponse.error) {
removeCircularRefs(errorResponse.error as JsonObject);

View file

@ -1502,6 +1502,9 @@ importers:
ast-types:
specifier: 0.15.2
version: 0.15.2
axios:
specifier: 1.6.7
version: 1.6.7(debug@3.2.7)
callsites:
specifier: 3.1.0
version: 3.1.0