1 #ifndef LIB2GEOM_EXCEPTION_HEADER
2 #define LIB2GEOM_EXCEPTION_HEADER
42 Exception(
const char * message,
const char *file,
const int line) {
43 std::ostringstream os;
44 os <<
"lib2geom exception: " << message <<
" (" << file <<
":" << line <<
")";
50 virtual const char* what()
const throw () {
51 return msgstr.c_str();
56 #define throwException(message) throw(Geom::Exception(message, __FILE__, __LINE__))
65 LogicalError(
const char * message,
const char *file,
const int line)
68 #define throwLogicalError(message) throw(LogicalError(message, __FILE__, __LINE__))
72 RangeError(
const char * message,
const char *file,
const int line)
75 #define throwRangeError(message) throw(RangeError(message, __FILE__, __LINE__))
85 #define throwNotImplemented(i) throw(NotImplemented(__FILE__, __LINE__))
92 #define throwInvariantsViolation(i) throw(InvariantsViolation(__FILE__, __LINE__))
93 #define assert_invariants(e) ((e) ? (void)0 : throwInvariantsViolation(0))
98 :
RangeError(
"Function does not have a unique inverse", file, line) {}
100 #define throwNotInvertible(i) throw(NotInvertible(__FILE__, __LINE__))
105 :
RangeError(
"Non-contiguous path", file, line) {}
107 #define throwContinuityError(i) throw(ContinuityError(__FILE__, __LINE__))
110 char const *what()
const throw() {
return "parse error"; }
Definition: exception.h:109
Definition: exception.h:87
Definition: exception.h:80
Definition: exception.h:63
Definition: exception.h:102
Definition: exception.h:40
Definition: exception.h:70
Definition: exception.h:95