1 /**
2  * Exception module
3  *
4  * Copyright: (c) 2015-2016, Milofon Project.
5  * License: Subject to the terms of the BSD license, as written in the included LICENSE.txt file.
6  * Authors: Maksim Galanin
7  */
8 module proped.exception;
9 
10 private
11 {
12     import std.format : format;
13 
14     import proped.properties : Properties;
15 }
16 
17 
18 
19 /**
20  * Loading properties exception
21  */
22 class PropertiesException : Exception
23 {
24     this(string msg, Throwable next = null, string file = __FILE__, size_t line = __LINE__)
25     {
26         super(msg ~ ((next !is null) ? "\n" ~ next.msg : ""), file, line, next);
27     }
28 }
29 
30 
31 
32 /**
33  * Manipulate properties exception
34  */
35 class PropertiesNotFoundException : Exception
36 {
37     this(Properties prop, string name, string file = __FILE__, size_t line = __LINE__)
38     {
39         super("Property '%s' not found (%s)".format(name, prop), file, line, null);
40     }
41 }
42