mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Improve the error returned to users on SSL issues (#6494)
This commit is contained in:
parent
7a95e08bfd
commit
1b084bc56b
|
@ -77,6 +77,7 @@ import {
|
||||||
fileTypeFromMimeType,
|
fileTypeFromMimeType,
|
||||||
ExpressionError,
|
ExpressionError,
|
||||||
validateFieldType,
|
validateFieldType,
|
||||||
|
NodeSSLError,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import pick from 'lodash/pick';
|
import pick from 'lodash/pick';
|
||||||
|
@ -727,6 +728,9 @@ export async function proxyRequestToAxios(
|
||||||
response: pick(response, ['headers', 'status', 'statusText']),
|
response: pick(response, ['headers', 'status', 'statusText']),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (error instanceof Error && error.message.includes('SSL routines'))
|
||||||
|
throw new NodeSSLError(error);
|
||||||
|
|
||||||
throw Object.assign(error, {
|
throw Object.assign(error, {
|
||||||
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
|
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue