Skip to content

Commit 8918ce9

Browse files
committed
Add system exception for os-related error
1 parent 29be3b3 commit 8918ce9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/util/exception_utils.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,23 @@ class invalid_user_input_exceptiont
3838
}
3939
};
4040

41+
class system_exceptiont
42+
{
43+
private:
44+
std::string reason;
45+
46+
public:
47+
system_exceptiont(const std::string &reason) : reason(reason)
48+
{
49+
}
50+
51+
std::string what() const noexcept
52+
{
53+
std::string res;
54+
res += "System Exception\n";
55+
res += "Reason: " + reason + "\n";
56+
return res;
57+
}
58+
};
59+
4160
#endif // CPROVER_UTIL_EXCEPTION_UTILS_H

0 commit comments

Comments
 (0)