Skip to content

Commit f29ca0c

Browse files
author
kroening
committed
new exception class
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@966 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 7228c28 commit f29ca0c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/util/error.h

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*******************************************************************\
2+
3+
Module:
4+
5+
Author: Daniel Kroening, [email protected]
6+
7+
\*******************************************************************/
8+
9+
#ifndef CPROVER_ERROR_H
10+
#define CPROVER_ERROR_H
11+
12+
#include <exception>
13+
#include <sstream>
14+
15+
#include "location.h"
16+
17+
class error_baset:public exception
18+
{
19+
public:
20+
virtual const char* what() const throw()
21+
{
22+
return "";
23+
}
24+
25+
locationt location;
26+
};
27+
28+
class error:public error_baset, public std::ostringstream
29+
{
30+
public:
31+
virtual const char* what() const throw()
32+
{
33+
return str().c_str();
34+
}
35+
};
36+
37+
#endif

0 commit comments

Comments
 (0)