Skip to content
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

Add custom AggregateException serializer. #266

Merged

Conversation

Arkatufus
Copy link
Contributor

Closes #265


namespace Hyperion.SerializerFactories
{
internal sealed class AggregateExceptionSerializerFactory : ValueSerializerFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the default ExceptionSerializerFactory not handle InnerExceptions? Or is this different because AggregateException can store multiple errors at each layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regular exceptions have InnerException, AggregateException have InnerException and InnerExceptions

@Aaronontheweb
Copy link
Member

@Arkatufus looks like WatsonBuckets isn't a supported property on Linux. Guess we should drop it?

info.AddValue("ExceptionMethod", stream.ReadString(session), typeof (string));
info.AddValue("HResult", stream.ReadInt32(session));
info.AddValue("Source", stream.ReadString(session), typeof (string));
info.AddValue("WatsonBuckets", stream.ReadLengthEncodedByteArray(session), typeof (byte[]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is what's causing the Linux specs to barf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess we need to drop it.

@Arkatufus
Copy link
Contributor Author

This serializer would not be available in .NET Standard 1.6

@Aaronontheweb
Copy link
Member

Do we have to support this property or can we elide it?

@Arkatufus
Copy link
Contributor Author

No idea, I'm just including as much as possible just in case

@Arkatufus
Copy link
Contributor Author

Arkatufus commented Oct 7, 2021

Turns out Watson Buckets is a legacy diagnostic data leftover from the XP era. We'll be removing it from the serialization since its windows specific and a bit archaic.

@Aaronontheweb Aaronontheweb merged commit b83c5bf into akkadotnet:dev Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception serializer fails to serialize AggregateException
2 participants