forked from apriori/xfbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathException.d
48 lines (42 loc) · 1.08 KB
/
Exception.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/+
+ Copyright Andrej Mitrovic 2011.
+ Copyright Tomasz Stachowiak 2009 - 2011.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+/
module xfbuild.Exception;
import std.exception;
class BuildException : Exception
{
string errorMsg;
this(string msg)
{
errorMsg = msg;
super(msg);
}
this(string msg, string file, size_t line, Exception next = null)
{
errorMsg = msg;
super(msg, file, line, next);
}
}
string ExceptionImpl(string name)
{
return(`
class ` ~ name ~ ` : BuildException
{
this(string msg)
{
super(msg);
}
this(string msg, string file, size_t line, Exception next = null)
{
super(msg, file, line, next);
}
}`);
}
mixin(ExceptionImpl("CompilerError"));
mixin(ExceptionImpl("ModuleException"));
mixin(ExceptionImpl("ParseException"));
mixin(ExceptionImpl("ProcessExecutionException"));