comparison druntime/import/core/exception.di @ 760:6f33b427bfd1

Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 12 Nov 2008 00:19:18 +0100
parents
children
comparison
equal deleted inserted replaced
759:d3eb054172f9 760:6f33b427bfd1
1 // D import file generated from 'core/exception.d'
2 module core.exception;
3 private
4 {
5 alias void function(string file, size_t line, string msg = null) assertHandlerType;
6 assertHandlerType assertHandler = null;
7 }
8 class ArrayBoundsException : Exception
9 {
10 this(string file, size_t line)
11 {
12 super("Array index out of bounds",file,line);
13 }
14 }
15 class AssertException : Exception
16 {
17 this(string file, size_t line)
18 {
19 super("Assertion failure",file,line);
20 }
21 this(string msg, string file, size_t line)
22 {
23 super(msg,file,line);
24 }
25 }
26 class FinalizeException : Exception
27 {
28 ClassInfo info;
29 this(ClassInfo c, Exception e = null)
30 {
31 super("Finalization error",e);
32 info = c;
33 }
34 override
35 {
36 string toString()
37 {
38 return "An exception was thrown while finalizing an instance of class " ~ info.name;
39 }
40 }
41 }
42 class HiddenFuncException : Exception
43 {
44 this(ClassInfo ci)
45 {
46 super("Hidden method called for " ~ ci.name);
47 }
48 }
49 class OutOfMemoryException : Exception
50 {
51 this(string file, size_t line)
52 {
53 super("Memory allocation failed",file,line);
54 }
55 override
56 {
57 string toString()
58 {
59 return msg ? super.toString() : "Memory allocation failed";
60 }
61 }
62 }
63 class SwitchException : Exception
64 {
65 this(string file, size_t line)
66 {
67 super("No appropriate switch clause found",file,line);
68 }
69 }
70 class UnicodeException : Exception
71 {
72 size_t idx;
73 this(string msg, size_t idx)
74 {
75 super(msg);
76 this.idx = idx;
77 }
78 }
79 void setAssertHandler(assertHandlerType h)
80 {
81 assertHandler = h;
82 }
83 extern (C)
84 {
85 void onAssertError(string file, size_t line);
86 }
87 extern (C)
88 {
89 void onAssertErrorMsg(string file, size_t line, string msg);
90 }
91 extern (C)
92 {
93 void onArrayBoundsError(string file, size_t line);
94 }
95 extern (C)
96 {
97 void onFinalizeError(ClassInfo info, Exception ex);
98 }
99 extern (C)
100 {
101 void onHiddenFuncError(Object o);
102 }
103 extern (C)
104 {
105 void onOutOfMemoryError();
106 }
107 extern (C)
108 {
109 void onSwitchError(string file, size_t line);
110 }
111 extern (C)
112 {
113 void onUnicodeError(string msg, size_t idx);
114 }