5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
10 using System.Runtime.Serialization;
11 using System.Reflection;
15 public class Exception : ISerializable {
16 Exception inner_exception;
19 string stack_trace = "TODO: implement stack traces";
21 private string source;
25 inner_exception = null;
29 public Exception (string msg)
31 inner_exception = null;
35 protected Exception (SerializationInfo info, StreamingContext sc)
38 throw new ArgumentNullException ("info");
41 // TODO: Implement the restoration of an Exception
45 public Exception (string msg, Exception e)
51 public Exception InnerException {
53 return inner_exception;
57 public string HelpLink {
67 protected int HResult {
77 public string Message {
83 public string Source {
85 // TODO: if source is null, we must return
86 // the name of the assembly where the error
96 public string StackTrace {
102 public MethodBase TargetSite {
104 // TODO: Implement this.
109 public virtual Exception GetBaseException ()
111 Exception inner = inner_exception;
113 while (inner != null){
114 if (inner.InnerException != null)
115 inner = inner.InnerException;
123 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
125 // TODO: implement me.
128 public override string ToString ()
130 return this.GetType ().FullName + "\n" +
132 GetBaseException ().GetType ().FullName +