Skip to content

Commit

Permalink
refactor(core): Prevent reporting to Sentry IMAP server error (no-cha…
Browse files Browse the repository at this point in the history
…ngelog) (#9515)
  • Loading branch information
ivov committed May 27, 2024
1 parent 1abb26e commit 6ed9ef0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/workflow/src/errors/workflow-activation.error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ export class WorkflowActivationError extends ExecutionBaseError {
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';
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe('WorkflowActivationError', () => {
expect(secondError.level).toBe('error');
});

test.each(['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH'])(
'should set `level` to `warning` for %s',
test.each(['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH', 'Temporary authentication failure'])(
'should set `level` to `warning` for `%s`',
(code) => {
const error = new WorkflowActivationError(code, { cause });

Expand Down

0 comments on commit 6ed9ef0

Please sign in to comment.