-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledExceptionEvent.ToString() Throws NotSupportedException #1362
Comments
Hi, thanks for this bug report. So far I've been unable to reproduce the problem. I would expect this unit test to show the error, but it passes: [Fact]
public void UnhandledExceptionEventCanCallToString()
{
var e = new UnhandledExceptionEvent(new Exception("Boom?"));
var s = e.ToString();
s.Should().NotBeNullOrEmpty();
} Does that test pass for you? |
Hi, my bad, the non serializable data is only added to the exception, if it is thrown. Try this: [TestMethod]
public void Test2()
{
try
{
throw new Exception();
}
catch (Exception ex)
{
var exception = new Duende.IdentityServer.Events.UnhandledExceptionEvent(ex);
var myString = exception.ToString();
}
} It should throw the exception
|
Thanks @JustusGreiberORGADATA, I'm reproducing the error now. |
@JustusGreiberORGADATA are you requesting that a fix for this issue be patched into the 6.3.x branch, or can you wait for v7? |
@josephdecock I know this is an issue now, so I don't care if it's only in v7. But just FYI: For other people upgrading to 6.3 it might be confusing, because the exception triggers if you are forgot to create the migrations. |
@JustusGreiberORGADATA , a fix for this is now merged and will be part of the next major release. |
This fixes #1362 Thrown exceptions can't be serialized by System.Text.Json, because they contain pointers that it won't allow. This fix (suppressing serialization) is specific to the 6.3 release. In 7.0, we will remove the property entirely.
Which version of Duende IdentityServer are you using?
6.3.2
Which version of .NET are you using?
NET 6
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
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).
The text was updated successfully, but these errors were encountered: