LogException.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #region Apache License
  2. //
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to you under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. #endregion
  19. using System;
  20. #if !NETCF
  21. using System.Runtime.Serialization;
  22. #endif
  23. namespace log4net.Core
  24. {
  25. /// <summary>
  26. /// Exception base type for log4net.
  27. /// </summary>
  28. /// <remarks>
  29. /// <para>
  30. /// This type extends <see cref="ApplicationException"/>. It
  31. /// does not add any new functionality but does differentiate the
  32. /// type of exception being thrown.
  33. /// </para>
  34. /// </remarks>
  35. /// <author>Nicko Cadell</author>
  36. /// <author>Gert Driesen</author>
  37. #if !NETCF
  38. [Serializable]
  39. #endif
  40. #if NETSTANDARD1_3
  41. public class LogException : Exception
  42. #else
  43. public class LogException : ApplicationException
  44. #endif
  45. {
  46. #region Public Instance Constructors
  47. /// <summary>
  48. /// Constructor
  49. /// </summary>
  50. /// <remarks>
  51. /// <para>
  52. /// Initializes a new instance of the <see cref="LogException" /> class.
  53. /// </para>
  54. /// </remarks>
  55. public LogException()
  56. {
  57. }
  58. /// <summary>
  59. /// Constructor
  60. /// </summary>
  61. /// <param name="message">A message to include with the exception.</param>
  62. /// <remarks>
  63. /// <para>
  64. /// Initializes a new instance of the <see cref="LogException" /> class with
  65. /// the specified message.
  66. /// </para>
  67. /// </remarks>
  68. public LogException(String message) : base(message)
  69. {
  70. }
  71. /// <summary>
  72. /// Constructor
  73. /// </summary>
  74. /// <param name="message">A message to include with the exception.</param>
  75. /// <param name="innerException">A nested exception to include.</param>
  76. /// <remarks>
  77. /// <para>
  78. /// Initializes a new instance of the <see cref="LogException" /> class
  79. /// with the specified message and inner exception.
  80. /// </para>
  81. /// </remarks>
  82. public LogException(String message, Exception innerException) : base(message, innerException)
  83. {
  84. }
  85. #endregion Public Instance Constructors
  86. #region Protected Instance Constructors
  87. #if !(NETCF || NETSTANDARD1_3)
  88. /// <summary>
  89. /// Serialization constructor
  90. /// </summary>
  91. /// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
  92. /// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
  93. /// <remarks>
  94. /// <para>
  95. /// Initializes a new instance of the <see cref="LogException" /> class
  96. /// with serialized data.
  97. /// </para>
  98. /// </remarks>
  99. protected LogException(SerializationInfo info, StreamingContext context) : base(info, context)
  100. {
  101. }
  102. #endif
  103. #endregion Protected Instance Constructors
  104. }
  105. }