1 module std.database.exception;
2 import std.exception;
3 
4 struct DatabaseError {
5     string message;
6 }
7 
8 class DatabaseException : Exception {
9     this(string msg, string file = __FILE__, size_t line = __LINE__) {
10         super(msg, file, line);
11     }
12 
13     this(ref DatabaseError error, string msg, string file = __FILE__, size_t line = __LINE__) {
14         super(msg ~ ": " ~ error.message, file, line);
15     }
16 }
17 
18 class ConnectionException : DatabaseException {
19     this(string msg, string file = __FILE__, size_t line = __LINE__) {
20         super(msg, file, line);
21     }
22 }
23