Skip to content

Commit cceeb4e

Browse files
Petr BauchPetr Bauch
authored andcommitted
Reshuffle exceptions
1 parent 7075395 commit cceeb4e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/goto-programs/slice_global_inits.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Date: December 2016
2121
#include <util/cprover_prefix.h>
2222
#include <util/prefix.h>
2323

24-
#include <util/exception_utils.h>
2524
#include <util/invariant.h>
2625

2726
#include <goto-programs/goto_functions.h>
@@ -36,7 +35,7 @@ void slice_global_inits(goto_modelt &goto_model)
3635
goto_functionst &goto_functions=goto_model.goto_functions;
3736

3837
if(goto_functions.function_map.count(entry_point) == 0)
39-
throw incorrect_goto_program_exceptiont("entry point not found");
38+
throw user_input_error_exceptiont("entry point not found");
4039

4140
// Get the call graph restricted to functions reachable from
4241
// the entry point:

src/goto-programs/slice_global_inits.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,27 @@ Date: December 2016
1414
#ifndef CPROVER_GOTO_PROGRAMS_SLICE_GLOBAL_INITS_H
1515
#define CPROVER_GOTO_PROGRAMS_SLICE_GLOBAL_INITS_H
1616

17+
#include <util/exception_utils.h>
18+
1719
class goto_modelt;
1820

21+
class user_input_error_exceptiont : public cprover_exception_baset
22+
{
23+
public:
24+
explicit user_input_error_exceptiont(std::string message)
25+
: message(std::move(message))
26+
{
27+
}
28+
29+
std::string what() const
30+
{
31+
return message;
32+
}
33+
34+
private:
35+
std::string message;
36+
};
37+
1938
void slice_global_inits(goto_modelt &);
2039

2140
#endif

src/util/parse_options.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ int parse_options_baset::main()
7676
std::cerr << e.what() << "\n";
7777
return CPROVER_EXIT_USAGE_ERROR;
7878
}
79-
catch(const incorrect_goto_program_exceptiont &e)
80-
{
81-
std::cerr << e.what() << "\n";
82-
return CPROVER_EXIT_INTERNAL_ERROR;
83-
}
8479
catch(const cprover_exception_baset &e)
8580
{
8681
std::cerr << e.what() << '\n';

0 commit comments

Comments
 (0)