Skip to content

Define error hints for abstract exception types #58367

@gdalle

Description

@gdalle

Currently, it seems error hints have to be defined for a concrete exception type. Indeed, this line

hinters = get(_hint_handlers, typeof(ex), nothing)

only gets exception handlers for typeof(ex), and not for its supertypes. Would a PR be welcome to change that?

Concrete use case: I have recently added a common error supertype to Enzyme, in order to be able to define hints based on it inside DifferentiationInterface. However, no exception has the type Enzyme.Compiler.EnzymeError, they have concrete subtypes of that which may change between versions since they are internal details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesBetter, more actionable error messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions