Skip to content

on async Main, unhandled exception unregisters before capturing crash #321

@bruno-garcia

Description

@bruno-garcia
static void Main(string[] args)
{
    using var _ = SentrySdk.Init();
    throw null;
}

This exception is captured as expected by the unhandled exception handler.

static async Task Main(string[] args)
{
    using var _ = SentrySdk.Init();
    throw null;
}

The code above doesn't work as expected. Before calling the UnhandledException handler the SDK goes out of the using "block" and unregisters the unhandled exception integration.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions