Skip to content

Allow to have some Exceptions treated as non-errors #40

@jsgoupil-covetlife

Description

@jsgoupil-covetlife

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions