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

Allow run in sandbox #325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Intuit.Ipp.Exception
/// TODO: Update summary.
/// </summary>
[System.Serializable]
public class IdsError : System.Exception
public class IdsError : System.Exception, ISafeSerializationData
{
/// <summary>
/// Error Code.
Expand Down Expand Up @@ -148,6 +148,7 @@ public string Detail
}
}

#if NETCORE
/// <summary>
/// Contains the System.Runtime.Serialization.SerializationInfo with information about the exception.
/// </summary>
Expand All @@ -165,5 +166,19 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
info.AddValue("detail", this.detail);
}
}
#endif

/// <summary>
/// This method is called when the instance is deserialized.
/// </summary>
/// <param name="deserialized">An object that contains the state of the instance.</param>
public void CompleteDeserialization(object deserialized)
{
IdsError exception = (IdsError)deserialized;
exception.errorCode = this.errorCode;
exception.errorMessage = this.errorMessage;
exception.element = this.element;
exception.detail = this.detail;
}
}
}
18 changes: 17 additions & 1 deletion IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Exception/IdsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Intuit.Ipp.Exception
/// Represents an IdsException.
/// </summary>
[System.Serializable]
public class IdsException : System.Exception
public class IdsException : System.Exception, ISafeSerializationData
{
/// <summary>
/// Error Code.
Expand Down Expand Up @@ -283,6 +283,7 @@ public ReadOnlyCollection<IdsError> InnerExceptions
}
}

#if NETCORE
/// <summary>
/// Contains the System.Runtime.Serialization.SerializationInfo with information about the exception.
/// </summary>
Expand All @@ -301,5 +302,20 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
info.AddValue("innerExceptions", this.innerExceptions);
}
}
#endif

/// <summary>
/// This method is called when the instance is deserialized.
/// </summary>
/// <param name="deserialized">An object that contains the state of the instance.</param>
public void CompleteDeserialization(object deserialized)
{
IdsException exception = (IdsException)deserialized;
exception.errorCode = this.errorCode;
exception.errorMessage = this.errorMessage;
exception.source = this.source;
exception.innerException = this.innerException;
exception.innerExceptions = this.innerExceptions;
}
}
}