@@ -13,7 +13,6 @@ Author: CM Wintersteiger
1313
1414#include < fstream>
1515
16- #include < util/exception_utils.h>
1716#include < util/irep_serialization.h>
1817#include < util/message.h>
1918
@@ -144,12 +143,14 @@ static void write_goto_binary(
144143bool write_goto_binary (
145144 std::ostream &out,
146145 const goto_modelt &goto_model,
146+ message_handlert &message_handler,
147147 int version)
148148{
149149 return write_goto_binary (
150150 out,
151151 goto_model.symbol_table ,
152152 goto_model.goto_functions ,
153+ message_handler,
153154 version);
154155}
155156
@@ -158,6 +159,7 @@ bool write_goto_binary(
158159 std::ostream &out,
159160 const symbol_table_baset &symbol_table,
160161 const goto_functionst &goto_functions,
162+ message_handlert &message_handler,
161163 int version)
162164{
163165 // header
@@ -169,15 +171,19 @@ bool write_goto_binary(
169171
170172 if (version < GOTO_BINARY_VERSION)
171173 {
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 ;
175179 }
176180 if (version > GOTO_BINARY_VERSION)
177181 {
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 ;
181187 }
182188 write_goto_binary (out, symbol_table, goto_functions, irepconverter);
183189 return false ;
@@ -198,5 +204,5 @@ bool write_goto_binary(
198204 return true ;
199205 }
200206
201- return write_goto_binary (out, goto_model);
207+ return write_goto_binary (out, goto_model, message_handler );
202208}
0 commit comments