refactor(core): Stop reporting EAUTH error codes to Sentry (no-changelog) (#9496)

This commit is contained in:
Iván Ovejero
2024-05-23 15:12:01 +02:00
committed by GitHub
parent 8737c0965e
commit f8683c31e0
4 changed files with 49 additions and 9 deletions

View File

@@ -32,6 +32,20 @@ export class WorkflowActivationError extends ExecutionBaseError {
this.node = node;
this.workflowId = workflowId;
this.message = message;
if (level) this.level = level;
this.setLevel(level);
}
private setLevel(level?: ApplicationError['level']) {
if (level) {
this.level = level;
return;
}
if (['ETIMEDOUT', 'ECONNREFUSED', 'EAUTH'].some((code) => this.message.includes(code))) {
this.level = 'warning';
return;
}
this.level = 'error';
}
}