Skip to content

Commit 06d388f

Browse files
committed
internals: unbroadening base exception classes
NotImplementedError : runtime_error ValueError : invalid_argument
1 parent 7fe7a71 commit 06d388f

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

include/pfasst/interfaces.hpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef _PFASST_INTERFACES_HPP_
66
#define _PFASST_INTERFACES_HPP_
77

8-
#include <exception>
98
#include <memory>
9+
#include <stdexcept>
1010
#include <string>
1111
using namespace std;
1212

@@ -23,12 +23,20 @@ namespace pfasst
2323
* that may not be necessary for all others.
2424
*/
2525
class NotImplementedYet
26-
: public exception
26+
: public runtime_error
2727
{
2828
protected:
2929
string msg;
30+
3031
public:
31-
NotImplementedYet(const string& msg);
32+
/**
33+
* @param[in] msg component or algorithm the throwing function is required for
34+
*/
35+
explicit NotImplementedYet(const string& msg);
36+
37+
/**
38+
* message string is prepended by the string `Not implemented/supported yet, required for: `
39+
*/
3240
virtual const char* what() const throw();
3341
};
3442

@@ -39,12 +47,17 @@ namespace pfasst
3947
* Thrown when a PFASST routine is passed an invalid value.
4048
*/
4149
class ValueError
42-
: public exception
50+
: public invalid_argument
4351
{
4452
protected:
4553
string msg;
54+
4655
public:
47-
ValueError(const string& msg);
56+
explicit ValueError(const string& msg);
57+
58+
/**
59+
* message string is prepended by the string `ValueError: `
60+
*/
4861
virtual const char* what() const throw();
4962
};
5063

@@ -89,7 +102,7 @@ namespace pfasst
89102

90103
/**
91104
* abstract SDC sweeper.
92-
* @tparam time time precision
105+
* @tparam time time precision;
93106
* defaults to pfasst::time_precision
94107
*/
95108
template<typename time = time_precision>
@@ -195,7 +208,7 @@ namespace pfasst
195208

196209
/**
197210
* abstract time/space transfer (restrict/interpolate) class.
198-
* @tparam time time precision
211+
* @tparam time time precision;
199212
* defaults to pfasst::time_precision
200213
*/
201214
template<typename time = time_precision>

include/pfasst/interfaces_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using namespace std;
1111
namespace pfasst
1212
{
1313
NotImplementedYet::NotImplementedYet(const string& msg)
14-
: msg(msg)
14+
: runtime_error(msg)
1515
{}
1616

1717
const char* NotImplementedYet::what() const throw()
@@ -21,7 +21,7 @@ namespace pfasst
2121

2222

2323
ValueError::ValueError(const string& msg)
24-
: msg(msg)
24+
: invalid_argument(msg)
2525
{}
2626

2727
const char* ValueError::what() const throw()

0 commit comments

Comments
 (0)