BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Exceptions.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Base/Types/Exceptions.cpp
6 //! @brief Implements class Exceptions.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #include "Base/Types/Exceptions.h"
16 #include <iostream>
17 
18 namespace Exceptions
19 {
20 
21 void LogExceptionMessage(const std::string&)
22 {
23  // std::cerr << message << std::endl;
24 }
25 
27  : std::logic_error(message)
28 {
29  LogExceptionMessage(message);
30 }
31 
32 NullPointerException::NullPointerException(const std::string& message) : std::logic_error(message)
33 {
34  LogExceptionMessage(message);
35 }
36 
37 OutOfBoundsException::OutOfBoundsException(const std::string& message) : std::logic_error(message)
38 {
39  LogExceptionMessage(message);
40 }
41 
43  : std::runtime_error(message)
44 {
45  LogExceptionMessage(message);
46 }
47 
49  : std::runtime_error(message)
50 {
51  LogExceptionMessage(message);
52 }
53 
55  : std::runtime_error(message)
56 {
57  LogExceptionMessage(message);
58 }
59 
60 LogicErrorException::LogicErrorException(const std::string& message) : std::logic_error(message)
61 {
62  LogExceptionMessage(message);
63 }
64 
66  : std::runtime_error(message)
67 {
68  LogExceptionMessage(message);
69 }
70 
72  : std::runtime_error(message)
73 {
74  LogExceptionMessage(message);
75 }
76 
77 DomainErrorException::DomainErrorException(const std::string& message) : std::domain_error(message)
78 {
79  LogExceptionMessage(message);
80 }
81 
83  : std::runtime_error(message)
84 {
85  LogExceptionMessage(message);
86 }
87 
88 FileIsBadException::FileIsBadException(const std::string& message) : std::runtime_error(message)
89 {
90  LogExceptionMessage(message);
91 }
92 
93 FormatErrorException::FormatErrorException(const std::string& message) : std::runtime_error(message)
94 {
95  LogExceptionMessage(message);
96 }
97 
98 } // namespace Exceptions
Defines many exception classes in namespace Exceptionss.
ClassInitializationException(const std::string &message)
Definition: Exceptions.cpp:42
DivisionByZeroException(const std::string &message)
Definition: Exceptions.cpp:71
DomainErrorException(const std::string &message)
Definition: Exceptions.cpp:77
ExistingClassRegistrationException(const std::string &message)
Definition: Exceptions.cpp:54
FileIsBadException(const std::string &message)
Definition: Exceptions.cpp:88
FileNotIsOpenException(const std::string &message)
Definition: Exceptions.cpp:82
FormatErrorException(const std::string &message)
Definition: Exceptions.cpp:93
LogicErrorException(const std::string &message)
Definition: Exceptions.cpp:60
NotImplementedException(const std::string &message)
Definition: Exceptions.cpp:26
NullPointerException(const std::string &message)
Definition: Exceptions.cpp:32
OutOfBoundsException(const std::string &message)
Definition: Exceptions.cpp:37
RuntimeErrorException(const std::string &message)
Definition: Exceptions.cpp:65
UnknownClassRegistrationException(const std::string &message)
Definition: Exceptions.cpp:48
Different exceptions, all inheriting from std::exception.
Definition: Exceptions.cpp:19
void LogExceptionMessage(const std::string &)
Definition: Exceptions.cpp:21