Skip to content

Unhandled exceptions inside Subscribe methods don't use newest UnhandledExceptionHandler #328

@Al12rs

Description

@Al12rs

Replacing the unhandled exception handler with ObservableSystem.RegisterUnhandledExceptionHandler doesn't make existing subscriptions utilize it correctly.

Subscribe and SubscribeAwait are embedding the handler at the moment of subscription creation, and not checking if it has changed when the exception actually occurs.

In our application, we have some DI created services set up subscriptions before our custom exception handler has been registered, making those subscriptions use the default handler rather than our custom one.

Delaying the subscriptions after the registration of the handler would be complex and impractical. It would be preferrable if the Subscribe methods instead used the most recently registered handler at the moment of the exception.

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