From b72579c4b1200459f959bcd6a25364e239420573 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 24 Jun 2022 15:07:29 +0700 Subject: Cleanup Exception classes --- .../cms/CMSAttributeTableGenerationException.cs | 34 ++++++++++++---------- crypto/src/cms/CMSException.cs | 20 +++++++------ crypto/src/cms/CMSStreamException.cs | 30 ++++++++++--------- 3 files changed, 45 insertions(+), 39 deletions(-) (limited to 'crypto/src/cms') diff --git a/crypto/src/cms/CMSAttributeTableGenerationException.cs b/crypto/src/cms/CMSAttributeTableGenerationException.cs index 692be2804..977d60e5c 100644 --- a/crypto/src/cms/CMSAttributeTableGenerationException.cs +++ b/crypto/src/cms/CMSAttributeTableGenerationException.cs @@ -1,28 +1,30 @@ using System; +using System.Runtime.Serialization; namespace Org.BouncyCastle.Cms { -#if !PORTABLE [Serializable] -#endif public class CmsAttributeTableGenerationException : CmsException { - public CmsAttributeTableGenerationException() - { - } + public CmsAttributeTableGenerationException() + : base() + { + } - public CmsAttributeTableGenerationException( - string name) - : base(name) - { - } + public CmsAttributeTableGenerationException(string message) + : base(message) + { + } - public CmsAttributeTableGenerationException( - string name, - Exception e) - : base(name, e) - { - } + public CmsAttributeTableGenerationException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected CmsAttributeTableGenerationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/crypto/src/cms/CMSException.cs b/crypto/src/cms/CMSException.cs index 83de3f00e..eab32f916 100644 --- a/crypto/src/cms/CMSException.cs +++ b/crypto/src/cms/CMSException.cs @@ -1,27 +1,29 @@ using System; +using System.Runtime.Serialization; namespace Org.BouncyCastle.Cms { -#if !PORTABLE [Serializable] -#endif public class CmsException : Exception { public CmsException() + : base() { } - public CmsException( - string msg) - : base(msg) + public CmsException(string message) + : base(message) { } - public CmsException( - string msg, - Exception e) - : base(msg, e) + public CmsException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected CmsException(SerializationInfo info, StreamingContext context) + : base(info, context) { } } diff --git a/crypto/src/cms/CMSStreamException.cs b/crypto/src/cms/CMSStreamException.cs index c3b0f9621..42ae409f7 100644 --- a/crypto/src/cms/CMSStreamException.cs +++ b/crypto/src/cms/CMSStreamException.cs @@ -1,29 +1,31 @@ using System; using System.IO; +using System.Runtime.Serialization; namespace Org.BouncyCastle.Cms { -#if !PORTABLE [Serializable] -#endif public class CmsStreamException : IOException { public CmsStreamException() + : base() { } - public CmsStreamException( - string name) - : base(name) - { - } + public CmsStreamException(string message) + : base(message) + { + } - public CmsStreamException( - string name, - Exception e) - : base(name, e) - { - } - } + public CmsStreamException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected CmsStreamException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } } -- cgit 1.5.1