xref: /haiku/src/servers/package/Exception.h (revision 37fedaf8494b34aad811abcc49e79aa32943f880)
1 /*
2  * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef EXCEPTION_H
6 #define EXCEPTION_H
7 
8 
9 #include <String.h>
10 
11 #include <package/DaemonDefs.h>
12 
13 
14 class Exception {
15 public:
16 								Exception(int32 error,
17 									const char* errorMessage = NULL,
18 									const char* packageName = NULL);
19 
20 			int32				Error() const
21 									{ return fError; }
22 
23 			const BString&		ErrorMessage() const
24 									{ return fErrorMessage; }
25 
26 			const BString&		PackageName() const
27 									{ return fPackageName; }
28 
29 			BString				ToString() const;
30 
31 private:
32 			int32				fError;
33 			BString				fErrorMessage;
34 			BString				fPackageName;
35 };
36 
37 
38 #endif	// EXCEPTION_H
39