@@ -13,7 +13,6 @@ Author: CM Wintersteiger
13
13
14
14
#include < fstream>
15
15
16
- #include < util/exception_utils.h>
17
16
#include < util/irep_serialization.h>
18
17
#include < util/message.h>
19
18
@@ -144,12 +143,14 @@ static void write_goto_binary(
144
143
bool write_goto_binary (
145
144
std::ostream &out,
146
145
const goto_modelt &goto_model,
146
+ message_handlert &message_handler,
147
147
int version)
148
148
{
149
149
return write_goto_binary (
150
150
out,
151
151
goto_model.symbol_table ,
152
152
goto_model.goto_functions ,
153
+ message_handler,
153
154
version);
154
155
}
155
156
@@ -158,6 +159,7 @@ bool write_goto_binary(
158
159
std::ostream &out,
159
160
const symbol_table_baset &symbol_table,
160
161
const goto_functionst &goto_functions,
162
+ message_handlert &message_handler,
161
163
int version)
162
164
{
163
165
// header
@@ -169,15 +171,19 @@ bool write_goto_binary(
169
171
170
172
if (version < GOTO_BINARY_VERSION)
171
173
{
172
- throw invalid_command_line_argument_exceptiont (
173
- " version " + std::to_string (version) + " no longer supported" ,
174
- " supported version = " + std::to_string (GOTO_BINARY_VERSION));
174
+ messaget message{message_handler};
175
+ message.error () << " version " << version << " no longer supported; "
176
+ << " supported version = " << GOTO_BINARY_VERSION
177
+ << messaget::eom;
178
+ return true ;
175
179
}
176
180
if (version > GOTO_BINARY_VERSION)
177
181
{
178
- throw invalid_command_line_argument_exceptiont (
179
- " unknown goto binary version " + std::to_string (version),
180
- " supported version = " + std::to_string (GOTO_BINARY_VERSION));
182
+ messaget message{message_handler};
183
+ message.error () << " unknown goto binary version " << version << " ; "
184
+ << " supported version = " << GOTO_BINARY_VERSION
185
+ << messaget::eom;
186
+ return true ;
181
187
}
182
188
write_goto_binary (out, symbol_table, goto_functions, irepconverter);
183
189
return false ;
@@ -198,5 +204,5 @@ bool write_goto_binary(
198
204
return true ;
199
205
}
200
206
201
- return write_goto_binary (out, goto_model);
207
+ return write_goto_binary (out, goto_model, message_handler );
202
208
}
0 commit comments