]>
Commit | Line | Data |
---|---|---|
58ee6135 RC |
1 | /* |
2 | * Copyright (c) 2001, Robert Collins. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | /* this is the parent class for all package source (not source code - installation | |
17 | * source as in http/ftp/disk file) operations. | |
18 | */ | |
19 | ||
20 | #ifndef _EXCEPTION_H_ | |
21 | #define _EXCEPTION_H_ | |
22 | ||
23 | #include <exception> | |
f37b36a3 | 24 | #include "String++.h" |
58ee6135 RC |
25 | |
26 | /* Generic excpetion class for throwing exceptions */ | |
666bf37d | 27 | class Exception : public std::exception { |
58ee6135 RC |
28 | public: |
29 | Exception (char const *where, char const *message, int appErrNo = 0); | |
f37b36a3 RC |
30 | Exception (char const *where, const String &message, int appErrNo = 0); |
31 | ~Exception () throw () {} | |
666bf37d | 32 | char const *what() const throw(); |
58ee6135 RC |
33 | int errNo() const; |
34 | private: | |
f37b36a3 | 35 | String _message; |
58ee6135 RC |
36 | int appErrNo; |
37 | }; | |
38 | ||
39 | // Where should these live? | |
40 | #define APPERR_CORRUPT_PACKAGE 1 | |
41 | #define APPERR_IO_ERROR 2 | |
ead15931 | 42 | #define APPERR_LOGIC_ERROR 3 |
58ee6135 RC |
43 | |
44 | #endif /* _EXCEPTION_H_ */ |