Skip to content

recordException should unwrap SomeException #162

@michaelpj

Description

@michaelpj

If you call recordException on an exception caught with catchAny or similar, you will get an uhelpful exception.type, namely SomeException itself. What you really want is the type of the inner exception. We can get this, we just have to unwrap it.

We do this ouselves in the codebase: https://github.com/iand675/hs-opentelemetry/blob/main/api/src/OpenTelemetry/Trace/Core.hs#L395

I think we should just teach recordException to do this itself. Perhaps just call cast to see if it's a SomeException, and if so unwrap it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions