mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Prevent reporting to Sentry IMAP server error (no-changelog) (#9515)
This commit is contained in:
@@ -41,7 +41,14 @@ export class WorkflowActivationError extends ExecutionBaseError {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH'].some((code) => this.message.includes(code))) {
|
if (
|
||||||
|
[
|
||||||
|
'etimedout', // Node.js
|
||||||
|
'econnrefused', // Node.js
|
||||||
|
'eauth', // OAuth
|
||||||
|
'temporary authentication failure', // IMAP server
|
||||||
|
].some((str) => this.message.toLowerCase().includes(str))
|
||||||
|
) {
|
||||||
this.level = 'warning';
|
this.level = 'warning';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ describe('WorkflowActivationError', () => {
|
|||||||
expect(secondError.level).toBe('error');
|
expect(secondError.level).toBe('error');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each(['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH'])(
|
test.each(['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH', 'Temporary authentication failure'])(
|
||||||
'should set `level` to `warning` for %s',
|
'should set `level` to `warning` for `%s`',
|
||||||
(code) => {
|
(code) => {
|
||||||
const error = new WorkflowActivationError(code, { cause });
|
const error = new WorkflowActivationError(code, { cause });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user