PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonException.cs

#
C# | 58 lines | 51 code | 7 blank | 0 comment | 0 complexity | 6188807d1f950eab52524d017039a4b6 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4using System.Runtime.Serialization;
 5using Microsoft.Scripting.Runtime;
 6
 7namespace IronPython.Runtime.Exceptions {
 8    [Serializable]
 9    class PythonException : Exception, IPythonAwareException {
10        private object _pyExceptionObject;
11        private List<DynamicStackFrame> _frames;
12        private TraceBack _traceback;
13
14        public PythonException() : base() { }
15        public PythonException(string msg) : base(msg) { }
16        public PythonException(string message, Exception innerException)
17            : base(message, innerException) {
18        }
19#if !SILVERLIGHT // SerializationInfo
20        protected PythonException(SerializationInfo info, StreamingContext context) : base(info, context) { }
21#endif
22
23        object IPythonAwareException.PythonException {
24            get {
25                return _pyExceptionObject;
26            }
27            set {
28                _pyExceptionObject = value;
29            }
30        }
31
32        List<DynamicStackFrame> IPythonAwareException.Frames {
33            get { return _frames; }
34            set { _frames = value; }
35        }
36
37        TraceBack IPythonAwareException.TraceBack {
38            get { return _traceback; }
39            set { _traceback = value; }
40        }
41    }
42
43    interface IPythonAwareException {
44        object PythonException {
45            get;
46            set;
47        }
48        List<DynamicStackFrame> Frames {
49            get;
50            set;
51        }
52
53        TraceBack TraceBack {
54            get;
55            set;
56        }
57    }
58}