fix(core): Improve the error returned to users on SSL issues (#6494)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-06-20 17:54:05 +02:00 committed by GitHub
parent 7a95e08bfd
commit 1b084bc56b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -77,6 +77,7 @@ import {
fileTypeFromMimeType,
ExpressionError,
validateFieldType,
NodeSSLError,
} from 'n8n-workflow';
import pick from 'lodash/pick';
@ -727,6 +728,9 @@ export async function proxyRequestToAxios(
response: pick(response, ['headers', 'status', 'statusText']),
});
} else {
if (error instanceof Error && error.message.includes('SSL routines'))
throw new NodeSSLError(error);
throw Object.assign(error, {
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
});

View file

@ -444,3 +444,9 @@ export class NodeApiError extends NodeError {
}
}
}
export class NodeSSLError extends ExecutionBaseError {
constructor(cause: Error) {
super("SSL Issue: consider using the 'Ignore SSL issues' option", { cause });
}
}