Merge pull request #2964 from ludovic-henry/sgen-monocontext
[mono.git] / mcs / class / referencesource / System.Web / Util / AppVerifierException.cs
1 namespace System.Web.Util {
2     using System;
3     using System.Diagnostics.CodeAnalysis;
4     using System.Runtime.Serialization;
5
6     // Thrown when the AppVerifier fails an assert.
7
8     // This type is used solely as a support / diagnostics tool and will never appear over the normal course of an application.
9     // Specifically, it will never cross an AppDomain boundary, and we don't want to mark it as [Serializable] since that is
10     // essentially a public contract, and the AppVerifier feature has no public API surface. We want to retain the ability to
11     // change this feature on a whim without risk of breaking anybody.
12     [SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Justification = "Doesn't need to be serializable.")]
13     internal sealed class AppVerifierException : Exception {
14
15         private readonly AppVerifierErrorCode _errorCode;
16
17         public AppVerifierException(AppVerifierErrorCode errorCode, string message)
18             : base(message) {
19
20             _errorCode = errorCode;
21         }
22
23         private AppVerifierException(SerializationInfo info, StreamingContext context) : base(info, context) { }
24
25         public AppVerifierErrorCode ErrorCode {
26             get {
27                 return _errorCode;
28             }
29         }
30
31     }
32 }