Skip to content

UnhandledExceptionEvent.ToString() Throws NotSupportedException #1362

@JustusGreiberORGADATA

Description

@JustusGreiberORGADATA

Which version of Duende IdentityServer are you using?
6.3.2
Which version of .NET are you using?
NET 6
Describe the bug

  1. System.Text.Json can't serialize exceptions. System.Text.Json - can't serialize exception dotnet/runtime#43026. It will refuse to serialize the contained IntPtr
  2. UnhandledExceptionEvent contains an exception https://github.com/DuendeSoftware/IdentityServer/blob/main/src/IdentityServer/Events/UnhandledExceptionEvent.cs#L44
  3. Event.ToString() calls LogSerializer.Serialize(this) which internally uses System.Text.Json https://github.com/DuendeSoftware/IdentityServer/blob/main/src/IdentityServer/Events/Infrastructure/Event.cs#L145

A clear and concise description of what the bug is.

To Reproduce

new UnhandledExceptionEvent(new Exception()).ToString();

should do it, although I haven't exactly tried, because in my case it happens during the OIDC flow (likely because I haven't migrated the database yet).

Metadata

Metadata

Assignees

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