41#ifndef LIB2GEOM_SEEN_EXCEPTION_H
42#define LIB2GEOM_SEEN_EXCEPTION_H
55 Exception(
const char * message,
const char *file,
const int line) {
56 std::ostringstream os;
57 os <<
"lib2geom exception: " << message <<
" (" << file <<
":" << line <<
")";
63 const char*
what() const noexcept
override {
69#define THROW_EXCEPTION(message) throw(Geom::Exception(message, __FILE__, __LINE__))
75 LogicalError(
const char * message,
const char *file,
const int line)
78#define THROW_LOGICALERROR(message) throw(LogicalError(message, __FILE__, __LINE__))
82 RangeError(
const char * message,
const char *file,
const int line)
85#define THROW_RANGEERROR(message) throw(RangeError(message, __FILE__, __LINE__))
95#define THROW_NOTIMPLEMENTED(i) throw(NotImplemented(__FILE__, __LINE__))
102#define THROW_INVARIANTSVIOLATION(i) throw(InvariantsViolation(__FILE__, __LINE__))
103#define ASSERT_INVARIANTS(e) ((e) ? (void)0 : THROW_INVARIANTSVIOLATION())
108 :
RangeError(
"Function does not have a unique inverse", file, line) {}
110#define THROW_NOTINVERTIBLE(i) throw(NotInvertible(__FILE__, __LINE__))
115 :
RangeError(
"There are infinite solutions", file, line) {}
117#define THROW_INFINITESOLUTIONS(i) throw(InfiniteSolutions(__FILE__, __LINE__))
124 :
RangeError(
"There are infinitely many solutions", file, line)
129#define THROW_INFINITELY_MANY_SOLUTIONS(msg) throw(InfinitelyManySolutions(__FILE__, __LINE__, msg))
134 :
RangeError(
"Non-contiguous path", file, line) {}
136#define THROW_CONTINUITYERROR(i) throw(ContinuityError(__FILE__, __LINE__))
139 char const *
what() const noexcept
override {
return "parse error"; }
ContinuityError(const char *file, const int line)
Base exception class, all 2geom exceptions should be derived from this one.
~Exception() noexcept override
Exception(const char *message, const char *file, const int line)
const char * what() const noexcept override
InfiniteSolutions(const char *file, const int line)
char const *const _message
InfinitelyManySolutions(const char *file, const int line, char const *message)
char const * what() const noexcept override
InvariantsViolation(const char *file, const int line)
LogicalError(const char *message, const char *file, const int line)
NotImplemented(const char *file, const int line)
NotInvertible(const char *file, const int line)
RangeError(const char *message, const char *file, const int line)
Various utility functions.
char const * what() const noexcept override