mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(core): Better errors for common status codes fix
This commit is contained in:
parent
570790ed0c
commit
700cc39cbc
|
@ -316,12 +316,17 @@ export class NodeApiError extends NodeError {
|
||||||
(error?.reason as IDataObject)?.description) as string;
|
(error?.reason as IDataObject)?.description) as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!httpCode && !message && error.status === 'rejected') {
|
if (
|
||||||
|
!httpCode &&
|
||||||
|
!message &&
|
||||||
|
this.message &&
|
||||||
|
this.message.toUpperCase().includes('ECONNREFUSED')
|
||||||
|
) {
|
||||||
httpCode = 'ECONNREFUSED';
|
httpCode = 'ECONNREFUSED';
|
||||||
|
|
||||||
const originalMessage = this.message;
|
const originalMessage = this.message;
|
||||||
if (!description && originalMessage) {
|
if (!description) {
|
||||||
this.description = `${originalMessage} ${this.description ?? ''}`;
|
this.description = `${originalMessage}; ${this.description ?? ''}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ describe('NodeErrors tests', () => {
|
||||||
|
|
||||||
it('should return default message for ECONNREFUSED', () => {
|
it('should return default message for ECONNREFUSED', () => {
|
||||||
const nodeApiError = new NodeApiError(node, {
|
const nodeApiError = new NodeApiError(node, {
|
||||||
status: 'rejected',
|
|
||||||
message: 'ECONNREFUSED',
|
message: 'ECONNREFUSED',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue