Skip to content

Commit

Permalink
Remove .NET Remoting method overloads from exception classes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfeeddeadbeef committed Nov 16, 2024
1 parent dc65e60 commit 7a873f3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
namespace TBC.OpenBanking.Jws.Exceptions;

using System;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

[Serializable]
public class CertificateValidationException : JwsException
Expand Down Expand Up @@ -80,6 +82,8 @@ public CertificateValidationException()
this.SetHResult(ErrorCode);
}

#if !NET8_0_OR_GREATER

protected CertificateValidationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Expand All @@ -102,4 +106,6 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
info.AddValue("message2", this.message, typeof(string));
base.GetObjectData(info, context);
}

#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
namespace TBC.OpenBanking.Jws.Exceptions;

using System;
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

[Serializable]
public class HeaderMissingException : JwsException
Expand All @@ -47,9 +49,11 @@ public HeaderMissingException(string message, Exception innerException)
this.SetHResult(ErrorCode);
}

#if !NET8_0_OR_GREATER
protected HeaderMissingException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.SetHResult(ErrorCode);
}
#endif
}
4 changes: 4 additions & 0 deletions src/TBC.OpenBanking.Jws/src/Exceptions/JwsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@
namespace TBC.OpenBanking.Jws.Exceptions;

using System;
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

[Serializable]
public abstract class JwsException : Exception
{
protected JwsException() { }
protected JwsException(string message) : base(message) { }
protected JwsException(string message, Exception inner) : base(message, inner) { }
#if !NET8_0_OR_GREATER
protected JwsException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif

protected const int SEVERITY_SUCCESS = 0;
protected const int SEVERITY_ERROR = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
namespace TBC.OpenBanking.Jws.Exceptions;

using System;
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

[Serializable]
public class SignatureVerificationProblemException : JwsException
Expand All @@ -47,9 +49,11 @@ public SignatureVerificationProblemException(string message, Exception innerExce
this.SetHResult(ErrorCode);
}

#if !NET8_0_OR_GREATER
protected SignatureVerificationProblemException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.SetHResult(ErrorCode);
}
#endif
}

0 comments on commit 7a873f3

Please sign in to comment.