refactor(core): Prevent reporting to Sentry IMAP server error (no-changelog) (#9515)

This commit is contained in:
Iván Ovejero 2024-05-27 16:52:17 +02:00 committed by GitHub
parent 1abb26e2da
commit 6ed9ef0b60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -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;
}

View file

@ -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 });