diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-05-13 02:24:07 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-13 02:24:07 +0000 |
commit | bc6f456ef27bdf25bf7a7f677217b9b7204b4241 (patch) | |
tree | 6b4f93f7448dde93240a0ba8d3643a37462f66ff /src/exception.h | |
parent | e6fc69187632612974cc650c28fe17d5a6d38e6a (diff) | |
download | libbu++-bc6f456ef27bdf25bf7a7f677217b9b7204b4241.tar.gz libbu++-bc6f456ef27bdf25bf7a7f677217b9b7204b4241.tar.bz2 libbu++-bc6f456ef27bdf25bf7a7f677217b9b7204b4241.tar.xz libbu++-bc6f456ef27bdf25bf7a7f677217b9b7204b4241.zip |
Added a nice, generic exception class. It really helps out a lot. I dunno if
it's better to create a new subclass of it for each situation, but it is cool...
Diffstat (limited to '')
-rw-r--r-- | src/exception.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/exception.h b/src/exception.h new file mode 100644 index 0000000..be876d7 --- /dev/null +++ b/src/exception.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef EXCEPTION_H | ||
2 | #define EXCEPTION_H | ||
3 | |||
4 | #include <string> | ||
5 | #include <exception> | ||
6 | |||
7 | class Exception : public std::exception | ||
8 | { | ||
9 | public: | ||
10 | Exception( const char *sFormat, ... ) throw(); | ||
11 | Exception( int nCode, const char *sFormat, ... ) throw(); | ||
12 | virtual ~Exception() throw(); | ||
13 | |||
14 | virtual const char *what() const throw(); | ||
15 | int getErrorCode(); | ||
16 | |||
17 | private: | ||
18 | char *sWhat; | ||
19 | int nErrorCode; | ||
20 | }; | ||
21 | |||
22 | #endif | ||