summaryrefslogtreecommitdiffabout
path: root/include/opkele/exception.h
Side-by-side diff
Diffstat (limited to 'include/opkele/exception.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/exception.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/opkele/exception.h b/include/opkele/exception.h
index 36bd07a..64f189e 100644
--- a/include/opkele/exception.h
+++ b/include/opkele/exception.h
@@ -32,103 +32,100 @@
*/
# define OPKELE_RETHROW catch(konforka::exception& e) { e.see(CODEPOINT); throw; }
#else /* OPKELE_HAVE_KONFORKA */
# include <exception>
# include <string>
/**
* the exception parameter declaration
*/
# define OPKELE_E_PARS const string& w
/**
* the dummy prefix for exception parameters list to prepend in the absence of
* konforka library
*/
# define OPKELE_E_CONS_
/**
* the dummy placeholder for konforka exception codepoint specification
*/
# define OPKELE_CP_
/**
* the dummy define for the opening function-try-block
*/
# define OPKELE_FUNC_TRY
/**
* the dummy define for the konforka-based rethrow of exception
*/
# define OPKELE_RETHROW
#endif /* OPKELE_HAVE_KONFORKA */
/**
* the exception parameters list to pass to constructor
*/
# define OPKELE_E_CONS OPKELE_E_CONS_ w
namespace opkele {
using std::string;
/**
* the base opkele exception class
*/
class exception : public
# ifdef OPKELE_HAVE_KONFORKA
konforka::exception
# else
std::exception
# endif
{
public:
# ifdef OPKELE_HAVE_KONFORKA
explicit
- exception(const string& fi,const string& fu,int l,const string& w)
- : konforka::exception(fi,fu,l,w) { }
+ exception(const string& fi,const string& fu,int l,const string& w);
# else /* OPKELE_HAVE_KONFORKA */
string _what;
- explicit
- exception(const string& w)
- : _what(w) { }
+ explicit exception(const string& w);
virtual ~exception() throw();
virtual const char * what() const throw();
# endif /* OPKELE_HAVE_KONFORKA */
};
/**
* thrown in case of failed conversion
*/
class failed_conversion : public exception {
public:
failed_conversion(OPKELE_E_PARS)
: exception(OPKELE_E_CONS) { }
};
/**
* thrown in case of failed lookup (either parameter or persistent store)
*/
class failed_lookup : public exception {
public:
failed_lookup(OPKELE_E_PARS)
: exception(OPKELE_E_CONS) { }
};
/**
* thrown in case of bad input (either local or network)
*/
class bad_input : public exception {
public:
bad_input(OPKELE_E_PARS)
: exception(OPKELE_E_CONS) { }
};
/**
* thrown on failed assertion
*/
class failed_assertion : public exception {
public:
failed_assertion(OPKELE_E_PARS)
: exception(OPKELE_E_CONS) { }
};
/**
* thrown if the handle being retrieved is invalid
*/
class invalid_handle : public exception {
public:
invalid_handle(OPKELE_E_PARS)
: exception(OPKELE_E_CONS) { }
};
/**