In my application, I do throw errors but they are fully recoverable.
So for instance, I would have
export class RecoverableError extends Error {}
export class MissingAccountError extends RecoverableError extends Error {}
When I throw a recoverable error, I would like the span to NOT be set to error.
I would be ready to override this behavior with DI, but your code is calling a static method directly so it's impossible for me to easily bypass this functionality.
|
private static recordException(error, span: Span) { |
|
span.setTag('error', error); |
|
throw error; |
|
DecoratorInjector.recordException(error, span); |
I can't even catch this properly because this is an internal span that is created by the library.
It's also wrapped in an activate, which will also tag this as an error again.
In my application, I do throw errors but they are fully recoverable.
So for instance, I would have
When I throw a recoverable error, I would like the
spanto NOT be set toerror.I would be ready to override this behavior with DI, but your code is calling a
staticmethod directly so it's impossible for me to easily bypass this functionality.nestjs-ddtrace/src/decorator.injector.ts
Lines 70 to 72 in c16fae0
nestjs-ddtrace/src/decorator.injector.ts
Line 195 in c16fae0
I can't even catch this properly because this is an internal span that is created by the library.
It's also wrapped in an activate, which will also tag this as an error again.