Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <stdexcept>
7 :
8 : /// \ingroup ErrorHandlingGroup
9 : /// Exception indicating an ASSERT failed
10 1 : class SpectreAssert : public std::runtime_error {
11 : public:
12 0 : explicit SpectreAssert(const std::string& message) : runtime_error(message) {}
13 : };
14 :
15 : /// \ingroup ErrorHandlingGroup
16 : /// Exception indicating an ERROR was triggered
17 1 : class SpectreError : public std::runtime_error {
18 : public:
19 0 : explicit SpectreError(const std::string& message) : runtime_error(message) {}
20 : };
21 :
22 : /// \ingroup ErrorHandlingGroup
23 : /// Exception indicating an ERROR was triggered because of an FPE
24 : ///
25 : /// \note You cannot rely on catching this exception for recovering from
26 : /// FPEs because not all compilers and hardware properly support throwing
27 : /// exceptions on FPEs.
28 1 : class SpectreFpe : public std::runtime_error {
29 : public:
30 0 : explicit SpectreFpe(const std::string& message) : runtime_error(message) {}
31 : };
32 :
33 : /// \ingroup ErrorHandlingGroup
34 : /// Exception indicating convergence failure
35 1 : class convergence_error : public std::runtime_error {
36 : public:
37 0 : explicit convergence_error(const std::string& message)
38 : : runtime_error(message) {}
39 : };
|