mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Ensure AxiosError status always gets copied over to NodeApiError (#8509)
This commit is contained in:
parent
4fed68ee34
commit
76c5a62f52
|
@ -51,6 +51,7 @@
|
||||||
"@n8n/tournament": "1.0.2",
|
"@n8n/tournament": "1.0.2",
|
||||||
"@n8n_io/riot-tmpl": "4.0.0",
|
"@n8n_io/riot-tmpl": "4.0.0",
|
||||||
"ast-types": "0.15.2",
|
"ast-types": "0.15.2",
|
||||||
|
"axios": "1.6.7",
|
||||||
"callsites": "3.1.0",
|
"callsites": "3.1.0",
|
||||||
"deep-equal": "2.2.0",
|
"deep-equal": "2.2.0",
|
||||||
"esprima-next": "5.8.4",
|
"esprima-next": "5.8.4",
|
||||||
|
|
|
@ -14,6 +14,7 @@ import type {
|
||||||
import { NodeError } from './abstract/node.error';
|
import { NodeError } from './abstract/node.error';
|
||||||
import { removeCircularRefs } from '../utils';
|
import { removeCircularRefs } from '../utils';
|
||||||
import type { ReportingOptions } from './application.error';
|
import type { ReportingOptions } from './application.error';
|
||||||
|
import { AxiosError } from 'axios';
|
||||||
|
|
||||||
export interface NodeOperationErrorOptions {
|
export interface NodeOperationErrorOptions {
|
||||||
message?: string;
|
message?: string;
|
||||||
|
@ -127,6 +128,10 @@ export class NodeApiError extends NodeError {
|
||||||
) {
|
) {
|
||||||
super(node, errorResponse);
|
super(node, errorResponse);
|
||||||
|
|
||||||
|
if (!httpCode && errorResponse instanceof AxiosError) {
|
||||||
|
httpCode = errorResponse.response?.status?.toString();
|
||||||
|
}
|
||||||
|
|
||||||
// only for request library error
|
// only for request library error
|
||||||
if (errorResponse.error) {
|
if (errorResponse.error) {
|
||||||
removeCircularRefs(errorResponse.error as JsonObject);
|
removeCircularRefs(errorResponse.error as JsonObject);
|
||||||
|
|
|
@ -1502,6 +1502,9 @@ importers:
|
||||||
ast-types:
|
ast-types:
|
||||||
specifier: 0.15.2
|
specifier: 0.15.2
|
||||||
version: 0.15.2
|
version: 0.15.2
|
||||||
|
axios:
|
||||||
|
specifier: 1.6.7
|
||||||
|
version: 1.6.7(debug@3.2.7)
|
||||||
callsites:
|
callsites:
|
||||||
specifier: 3.1.0
|
specifier: 3.1.0
|
||||||
version: 3.1.0
|
version: 3.1.0
|
||||||
|
|
Loading…
Reference in a new issue