Macaulay2 Engine
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1
#ifndef _exceptions_h_
2
#define _exceptions_h_
3
36
37
#include <stdexcept>
38
#include <string>
39
40
namespace
exc
{
41
struct
engine_error
:
public
std::runtime_error
42
{
43
explicit
engine_error
(
const
std::string &msg) :
std
::runtime_error(msg) {}
44
};
45
struct
overflow_exception
:
public
engine_error
46
{
47
explicit
overflow_exception
(
const
std::string &msg) :
engine_error
(msg) {}
48
};
49
struct
division_by_zero_error
:
public
engine_error
50
{
51
explicit
division_by_zero_error
(
const
std::string &msg) :
engine_error
(msg) {}
52
explicit
division_by_zero_error
() :
engine_error
(
std
::string{
"division by zero"
}) {}
53
};
54
struct
internal_error
:
public
engine_error
55
{
56
explicit
internal_error
(
const
std::string &msg) :
engine_error
(msg) {}
57
};
58
}
59
60
#define TRY \
61
try \
62
{
63
#define CATCH \
64
} \
65
catch (const exc::engine_error& __x424621) \
66
{ \
67
ERROR(__x424621.what()); \
68
return NULL; \
69
}
70
71
#endif
72
// Local Variables:
73
// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
74
// indent-tabs-mode: nil
75
// End:
exc
Definition
exceptions.hpp:40
std
STL namespace.
exc::division_by_zero_error::division_by_zero_error
division_by_zero_error()
Definition
exceptions.hpp:52
exc::division_by_zero_error::division_by_zero_error
division_by_zero_error(const std::string &msg)
Definition
exceptions.hpp:51
exc::engine_error::engine_error
engine_error(const std::string &msg)
Definition
exceptions.hpp:43
exc::internal_error::internal_error
internal_error(const std::string &msg)
Definition
exceptions.hpp:56
exc::overflow_exception::overflow_exception
overflow_exception(const std::string &msg)
Definition
exceptions.hpp:47
Macaulay2
e
exceptions.hpp
Generated on
for Macaulay2 Engine by
1.15.0