Skip to content

Commit 16363ad

Browse files
Add deserialization exception class
1 parent c19c83a commit 16363ad

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/util/exception_utils.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Author: Fotis Koutoulakis, [email protected]
88

99
#include "exception_utils.h"
1010

11+
#include <utility>
12+
1113
std::string invalid_user_input_exceptiont::what() const noexcept
1214
{
1315
std::string res;
@@ -18,3 +20,11 @@ std::string invalid_user_input_exceptiont::what() const noexcept
1820
res += correct_input + "\n";
1921
return res;
2022
}
23+
24+
deserialization_exceptiont::deserialization_exceptiont(std::string message)
25+
: message(std::move(message))
26+
{}
27+
28+
std::string deserialization_exceptiont::what() const noexcept {
29+
return message;
30+
}

src/util/exception_utils.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,13 @@ class system_exceptiont
5252
}
5353
};
5454

55+
class deserialization_exceptiont
56+
{
57+
public:
58+
explicit deserialization_exceptiont(std::string message);
59+
std::string what() const noexcept;
60+
private:
61+
std::string message;
62+
};
63+
5564
#endif // CPROVER_UTIL_EXCEPTION_UTILS_H

0 commit comments

Comments
 (0)