mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Ensure AxiosError status always gets copied over to NodeApiError (#8509)
This commit is contained in:
committed by
GitHub
parent
4fed68ee34
commit
76c5a62f52
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user