680 |
11 Oct 06 |
jari |
1 |
#ifndef _theplu_yat_utility_exception_ |
680 |
11 Oct 06 |
jari |
2 |
#define _theplu_yat_utility_exception_ |
675 |
10 Oct 06 |
jari |
3 |
|
341 |
07 Jun 05 |
jari |
// $Id$ |
341 |
07 Jun 05 |
jari |
5 |
|
570 |
05 Apr 06 |
jari |
6 |
/* |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2010, 2020 Peter Johansson |
570 |
05 Apr 06 |
jari |
9 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
570 |
05 Apr 06 |
jari |
11 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
570 |
05 Apr 06 |
jari |
16 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
570 |
05 Apr 06 |
jari |
General Public License for more details. |
570 |
05 Apr 06 |
jari |
21 |
|
570 |
05 Apr 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
570 |
05 Apr 06 |
jari |
24 |
*/ |
570 |
05 Apr 06 |
jari |
25 |
|
341 |
07 Jun 05 |
jari |
26 |
#include <stdexcept> |
341 |
07 Jun 05 |
jari |
27 |
#include <string> |
341 |
07 Jun 05 |
jari |
28 |
|
341 |
07 Jun 05 |
jari |
29 |
namespace theplu { |
680 |
11 Oct 06 |
jari |
30 |
namespace yat { |
341 |
07 Jun 05 |
jari |
31 |
namespace utility { |
341 |
07 Jun 05 |
jari |
32 |
|
4003 |
15 Oct 20 |
peter |
33 |
/** |
4003 |
15 Oct 20 |
peter |
\brief Class used for all invalid arguments detected within yat library. |
4004 |
15 Oct 20 |
peter |
35 |
|
4004 |
15 Oct 20 |
peter |
\since New in yat 0.19 |
4003 |
15 Oct 20 |
peter |
37 |
*/ |
4003 |
15 Oct 20 |
peter |
38 |
class invalid_argument : public std::invalid_argument |
4003 |
15 Oct 20 |
peter |
39 |
{ |
4003 |
15 Oct 20 |
peter |
40 |
public: |
4003 |
15 Oct 20 |
peter |
41 |
/** |
4003 |
15 Oct 20 |
peter |
\brief Constructor |
2210 |
05 Mar 10 |
peter |
43 |
|
4003 |
15 Oct 20 |
peter |
\param message message to be displayed using function what(). |
4003 |
15 Oct 20 |
peter |
45 |
*/ |
4003 |
15 Oct 20 |
peter |
46 |
invalid_argument(const std::string& message); |
4003 |
15 Oct 20 |
peter |
47 |
}; |
4003 |
15 Oct 20 |
peter |
48 |
|
4003 |
15 Oct 20 |
peter |
49 |
|
738 |
07 Jan 07 |
jari |
50 |
/** |
2210 |
05 Mar 10 |
peter |
\brief Class used for all runtime error detected within yat library. |
2210 |
05 Mar 10 |
peter |
52 |
*/ |
2210 |
05 Mar 10 |
peter |
53 |
class runtime_error : public std::runtime_error |
2210 |
05 Mar 10 |
peter |
54 |
{ |
2210 |
05 Mar 10 |
peter |
55 |
public: |
2210 |
05 Mar 10 |
peter |
56 |
/** |
2210 |
05 Mar 10 |
peter |
\brief Constructor |
2210 |
05 Mar 10 |
peter |
58 |
|
2210 |
05 Mar 10 |
peter |
\param message message to be displayed using function what(). |
2210 |
05 Mar 10 |
peter |
60 |
*/ |
2210 |
05 Mar 10 |
peter |
61 |
runtime_error(std::string message); |
2210 |
05 Mar 10 |
peter |
62 |
}; |
2210 |
05 Mar 10 |
peter |
63 |
|
2210 |
05 Mar 10 |
peter |
64 |
|
2210 |
05 Mar 10 |
peter |
65 |
/** |
1178 |
27 Feb 08 |
peter |
\brief Class used for error reported from Commandline or Option. |
1178 |
27 Feb 08 |
peter |
67 |
*/ |
2459 |
03 Apr 11 |
peter |
68 |
class cmd_error : public runtime_error |
1178 |
27 Feb 08 |
peter |
69 |
{ |
1178 |
27 Feb 08 |
peter |
70 |
public: |
1186 |
28 Feb 08 |
peter |
71 |
/** |
1186 |
28 Feb 08 |
peter |
\brief Constructor |
1186 |
28 Feb 08 |
peter |
73 |
|
1186 |
28 Feb 08 |
peter |
\param message message to be displayed using function what(). |
1186 |
28 Feb 08 |
peter |
75 |
*/ |
2209 |
05 Mar 10 |
peter |
76 |
cmd_error(std::string message); |
1178 |
27 Feb 08 |
peter |
77 |
}; |
1178 |
27 Feb 08 |
peter |
78 |
|
1178 |
27 Feb 08 |
peter |
79 |
|
1178 |
27 Feb 08 |
peter |
80 |
/** |
2330 |
01 Oct 10 |
peter |
\brief Class that contains information reported via global |
2209 |
05 Mar 10 |
peter |
variable errno. |
2331 |
02 Oct 10 |
peter |
83 |
|
2331 |
02 Oct 10 |
peter |
\since New in yat 0.7 |
2209 |
05 Mar 10 |
peter |
85 |
*/ |
2459 |
03 Apr 11 |
peter |
86 |
class errno_error : public runtime_error |
2209 |
05 Mar 10 |
peter |
87 |
{ |
2209 |
05 Mar 10 |
peter |
88 |
public: |
2209 |
05 Mar 10 |
peter |
89 |
/** |
2209 |
05 Mar 10 |
peter |
The error message, return from what(), is set to |
2209 |
05 Mar 10 |
peter |
\a message + strerror(errno) |
2209 |
05 Mar 10 |
peter |
92 |
*/ |
2209 |
05 Mar 10 |
peter |
93 |
errno_error(std::string message); |
2209 |
05 Mar 10 |
peter |
94 |
}; |
2209 |
05 Mar 10 |
peter |
95 |
|
2209 |
05 Mar 10 |
peter |
96 |
/** |
738 |
07 Jan 07 |
jari |
\brief Class for errors reported from underlying GSL calls. |
761 |
20 Feb 07 |
jari |
98 |
|
761 |
20 Feb 07 |
jari |
GSL_error is used in the same way as C++ standard library |
761 |
20 Feb 07 |
jari |
exceptions. |
738 |
07 Jan 07 |
jari |
101 |
*/ |
2459 |
03 Apr 11 |
peter |
102 |
class GSL_error : public runtime_error |
738 |
07 Jan 07 |
jari |
103 |
{ |
738 |
07 Jan 07 |
jari |
104 |
public: |
738 |
07 Jan 07 |
jari |
105 |
/** |
761 |
20 Feb 07 |
jari |
\brief Constructor to create an exception with a message. |
738 |
07 Jan 07 |
jari |
107 |
*/ |
2210 |
05 Mar 10 |
peter |
108 |
GSL_error(std::string message); |
738 |
07 Jan 07 |
jari |
109 |
|
738 |
07 Jan 07 |
jari |
110 |
/** |
738 |
07 Jan 07 |
jari |
\brief Constructor to create an exception with a message |
761 |
20 Feb 07 |
jari |
containg the GSL error description. |
738 |
07 Jan 07 |
jari |
113 |
*/ |
2210 |
05 Mar 10 |
peter |
114 |
GSL_error(std::string message, int gsl_status); |
738 |
07 Jan 07 |
jari |
115 |
}; |
738 |
07 Jan 07 |
jari |
116 |
|
738 |
07 Jan 07 |
jari |
117 |
|
761 |
20 Feb 07 |
jari |
118 |
/** |
761 |
20 Feb 07 |
jari |
\brief Class to report errors associated with IO operations. |
761 |
20 Feb 07 |
jari |
120 |
|
761 |
20 Feb 07 |
jari |
IO_error is used in the same way as C++ standard library |
761 |
20 Feb 07 |
jari |
exceptions. |
761 |
20 Feb 07 |
jari |
123 |
*/ |
2459 |
03 Apr 11 |
peter |
124 |
class IO_error : public runtime_error |
341 |
07 Jun 05 |
jari |
125 |
{ |
341 |
07 Jun 05 |
jari |
126 |
public: |
738 |
07 Jan 07 |
jari |
127 |
/** |
761 |
20 Feb 07 |
jari |
\brief Constructor to create an exception with a message. |
738 |
07 Jan 07 |
jari |
129 |
*/ |
2210 |
05 Mar 10 |
peter |
130 |
IO_error(std::string message); |
341 |
07 Jun 05 |
jari |
131 |
}; |
341 |
07 Jun 05 |
jari |
132 |
|
687 |
16 Oct 06 |
jari |
133 |
}}} // of namespace utility, yat, and theplu |
341 |
07 Jun 05 |
jari |
134 |
|
341 |
07 Jun 05 |
jari |
135 |
#endif |