mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -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_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",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue