refactor(core): Stop reporting to Sentry invalid credentials on workflow activation (no-changelog) (#9555)

This commit is contained in:
Iván Ovejero
2024-05-31 15:41:08 +02:00
committed by GitHub
parent 7fc00d8d10
commit 327794127e
2 changed files with 11 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ export class WorkflowActivationError extends ExecutionBaseError {
'econnrefused', // Node.js 'econnrefused', // Node.js
'eauth', // OAuth 'eauth', // OAuth
'temporary authentication failure', // IMAP server 'temporary authentication failure', // IMAP server
'invalid credentials',
].some((str) => this.message.toLowerCase().includes(str)) ].some((str) => this.message.toLowerCase().includes(str))
) { ) {
this.level = 'warning'; this.level = 'warning';

View File

@@ -18,12 +18,15 @@ describe('WorkflowActivationError', () => {
expect(secondError.level).toBe('error'); expect(secondError.level).toBe('error');
}); });
test.each(['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH', 'Temporary authentication failure'])( test.each([
'should set `level` to `warning` for `%s`', 'ETIMEDOUT',
(code) => { 'ECONNREFUSED',
'EAUTH',
'Temporary authentication failure',
'Invalid credentials',
])('should set `level` to `warning` for `%s`', (code) => {
const error = new WorkflowActivationError(code, { cause }); const error = new WorkflowActivationError(code, { cause });
expect(error.level).toBe('warning'); expect(error.level).toBe('warning');
}, });
);
}); });