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

Make the custom exception types serializable #369

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Aug 1, 2019

refs #365 :

-Mark the custom exception types as Serializable
-Add the constructor overloads needed for deserialization
-Add unit tests for (de)serialization

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

Copy link
Member

@piksel piksel left a comment

Choose a reason for hiding this comment

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

The tests may be reduced a bit, but it's not necessary. I'm OK with merging this either way.

/// The System.Runtime.Serialization.StreamingContext that contains contextual information
/// about the source or destination.
/// </param>
protected SharpZipBaseException(SerializationInfo info, StreamingContext context)
Copy link
Member

Choose a reason for hiding this comment

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

This was actually needed since we're inheriting from Exception (which implements ISerializable). But at least we can just chain the base constructor.

@Numpsy Numpsy mentioned this pull request Aug 6, 2019
@piksel piksel merged commit 36ece7a into icsharpcode:master Aug 8, 2019
@Numpsy Numpsy deleted the rw/365 branch August 8, 2019 21:01
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.

2 participants