3 #ifndef _CL_EXCEPTION_H
4 #define _CL_EXCEPTION_H
11 // Base class of all exception classes thrown by CLN.
12 class runtime_exception : public std::runtime_error {
15 : std::runtime_error(std::string()) {}
16 explicit runtime_exception (const std::string & what)
17 : std::runtime_error(what) {}
20 // Thrown when an assertion is violated.
21 class notreached_exception : public runtime_exception {
23 notreached_exception (const char* filename, int lineno);
26 // Thrown when a pole is encountered.
27 class division_by_0_exception : public runtime_exception {
29 division_by_0_exception ();
32 // Thrown when a conversion with As(TYPE)(VALUE) fails.
33 class as_exception : public runtime_exception {
35 as_exception (const class cl_number& obj, const char * typestring, const char * filename, int line);
40 #endif /* _CL_EXCEPTION_H */