Skip to content

Commit

Permalink
Remove Serializable on IscException
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Jan 17, 2024
1 parent 60db5e7 commit 8fb1953
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/FirebirdSql.Data.FirebirdClient/Common/IscException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

namespace FirebirdSql.Data.Common;

[Serializable]
internal sealed class IscException : Exception
{
private string _message;
Expand Down Expand Up @@ -117,27 +116,13 @@ public static IscException ForIOException(IOException exception)
return ForErrorCodes(new[] { IscCodes.isc_net_write_err, IscCodes.isc_net_read_err }, exception);
}

private IscException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Errors = (List<IscError>)info.GetValue(nameof(Errors), typeof(List<IscError>));
ErrorCode = info.GetInt32(nameof(ErrorCode));
}

public void BuildExceptionData()
{
BuildErrorCode();
BuildSqlState();
BuildExceptionMessage();
}

public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue(nameof(Errors), Errors);
info.AddValue(nameof(ErrorCode), ErrorCode);
}

private void BuildErrorCode()
{
ErrorCode = Errors.Count != 0 ? Errors[0].ErrorCode : 0;
Expand Down

0 comments on commit 8fb1953

Please sign in to comment.