mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -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;
|
||||
}
|
||||
|
||||
if (!httpCode && !message && error.status === 'rejected') {
|
||||
if (
|
||||
!httpCode &&
|
||||
!message &&
|
||||
this.message &&
|
||||
this.message.toUpperCase().includes('ECONNREFUSED')
|
||||
) {
|
||||
httpCode = 'ECONNREFUSED';
|
||||
|
||||
const originalMessage = this.message;
|
||||
if (!description && originalMessage) {
|
||||
this.description = `${originalMessage} ${this.description ?? ''}`;
|
||||
if (!description) {
|
||||
this.description = `${originalMessage}; ${this.description ?? ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ describe('NodeErrors tests', () => {
|
|||
|
||||
it('should return default message for ECONNREFUSED', () => {
|
||||
const nodeApiError = new NodeApiError(node, {
|
||||
status: 'rejected',
|
||||
message: 'ECONNREFUSED',
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue