mscorlib(4.0.0.0) API with additions
ExternalException.cs
3 
5 {
8  [ComVisible(true)]
10  {
13  public virtual int ErrorCode => base.HResult;
14 
17  : base(Environment.GetResourceString("Arg_ExternalException"))
18  {
19  SetErrorCode(-2147467259);
20  }
21 
24  public ExternalException(string message)
25  : base(message)
26  {
27  SetErrorCode(-2147467259);
28  }
29 
33  public ExternalException(string message, Exception inner)
34  : base(message, inner)
35  {
36  SetErrorCode(-2147467259);
37  }
38 
42  public ExternalException(string message, int errorCode)
43  : base(message)
44  {
45  SetErrorCode(errorCode);
46  }
47 
54  : base(info, context)
55  {
56  }
57 
60  public override string ToString()
61  {
62  string message = Message;
63  string str = GetType().ToString();
64  string text = str + " (0x" + base.HResult.ToString("X8", CultureInfo.InvariantCulture) + ")";
65  if (!string.IsNullOrEmpty(message))
66  {
67  text = text + ": " + message;
68  }
69  Exception innerException = base.InnerException;
70  if (innerException != null)
71  {
72  text = text + " ---> " + innerException.ToString();
73  }
74  if (StackTrace != null)
75  {
76  text = text + Environment.NewLine + StackTrace;
77  }
78  return text;
79  }
80  }
81 }
override string ToString()
Creates and returns a string representation of the current exception.
Definition: Exception.cs:474
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
static string NewLine
Gets the newline string defined for this environment.
Definition: Environment.cs:449
Serves as the base class for system exceptions namespace.
Definition: __Canon.cs:3
new Type GetType()
Gets the runtime type of the current instance.
Definition: Exception.cs:753
override string ToString()
Returns a String representing the name of the current Type.
Definition: Type.cs:2788
ExternalException(string message, int errorCode)
Initializes a new instance of the ExternalException class with a specified error message and the HRES...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
virtual string StackTrace
Gets a string representation of the immediate frames on the call stack.
Definition: Exception.cs:162
Exception InnerException
Gets the T:System.Exception instance that caused the current exception.
Definition: Exception.cs:139
ExternalException(string message)
Initializes a new instance of the ExternalException class with a specified error message.
override string ToString()
Returns a string that contains the HRESULT of the error.
virtual string Message
Gets a message that describes the current exception.
Definition: Exception.cs:95
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
ExternalException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the ExternalException class from serialization data.
The base exception type for all COM interop exceptions and structured exception handling (SEH) except...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
ExternalException(string message, Exception inner)
Initializes a new instance of the T:System.Runtime.InteropServices.ExternalException class with a spe...
Specifies that the class can be serialized.
virtual int ErrorCode
Gets the HRESULT of the error.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
ExternalException()
Initializes a new instance of the ExternalException class with default properties.