3 #ifndef _CL_EXCEPTION_H
4 #define _CL_EXCEPTION_H
10 // Base class of all exception classes thrown by CLN.
11 class runtime_exception : public std::runtime_error {
14 : std::runtime_error(std::string()) {}
15 explicit runtime_exception (const std::string & what)
16 : std::runtime_error(what) {}
19 // Thrown when an assertion is violated.
20 class notreached_exception : public runtime_exception {
22 notreached_exception (const char* filename, int lineno);
25 // Thrown when a pole is encountered.
26 class division_by_0_exception : public runtime_exception {
28 division_by_0_exception ();
31 // Thrown when a conversion with As(TYPE)(VALUE) fails.
32 class as_exception : public runtime_exception {
34 as_exception (const class cl_number& obj, const char * typestring, const char * filename, int line);
39 #endif /* _CL_EXCEPTION_H */