antioch-0.4.0
antioch_exceptions.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 
27 #ifndef ANTIOCH_EXCEPTIONS_H
28 #define ANTIOCH_EXCEPTIONS_H
29 
30 // C++
31 #include <stdexcept>
32 #include <string>
33 
34 namespace Antioch
35 {
40  class LogicError : public std::logic_error
41  {
42  public:
43  LogicError() : std::logic_error( "Error in Antioch internal logic" ) {}
44  };
45 
51  class NotImplemented : public std::logic_error
52  {
53  public:
54  NotImplemented() : std::logic_error( "Error: not implemented!" ) {}
55  };
56 
64  class FileError : public std::runtime_error
65  {
66  public:
67  FileError(const std::string& filename) : std::runtime_error( "Error accessing file: " + filename ) {}
68  };
69 
73  class FailedNewtonTTvInversion : public std::runtime_error
74  {
75  public:
76  FailedNewtonTTvInversion (const std::string &description)
77  : std::runtime_error (description)
78  {}
79  };
80 
84  class UnitError : public std::runtime_error
85  {
86  public:
87  UnitError(const std::string &description)
88  : std::runtime_error (description)
89  {}
90  };
91 
95  class ParsingError : public std::runtime_error
96  {
97  public:
98  ParsingError(const std::string &description)
99  : std::runtime_error (description)
100  {}
101  };
102 
103 } // end namespace Antioch
104 
105 #define ANTIOCH_THROW(e) do { throw e; } while (0)
106 
107 #endif // ANTIOCH_EXCEPTIONS_H
FileError(const std::string &filename)
FailedNewtonTTvInversion(const std::string &description)
A class representing error in units.
A class representing failed Newton convergence in T/Tv inversion.
ParsingError(const std::string &description)
A class to stub for features that should be in Antioch, but haven't been written yet, to be thrown by "antioch_not_implemented();".
UnitError(const std::string &description)
A class representing error while parsing.
The parameters are reduced parameters.
A class representing a failed attempt by the library to open a file (or construct an fstream...
A class to represent the internal "this should never happen" errors, to be thrown by "antioch_error()...

Generated on Thu Jul 7 2016 11:09:46 for antioch-0.4.0 by  doxygen 1.8.8