Skip to content

Commit 747dd2e

Browse files
author
brichards64
committed
corrected error throw so catches properly
1 parent 1ed6af2 commit 747dd2e

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/ToolChain/ToolChain.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ int ToolChain::Initialise(){
142142
}
143143
catch(std::exception& e){
144144
*m_log<<MsgL(0,m_verbose)<<red<<e.what()<<"\n"<<std::endl;
145-
throw;
145+
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!! "<<m_toolnames.at(i)<<" Failed to initialise (uncaught error)\n"<<std::endl;
146+
result=2;
147+
if(m_errorlevel>0) exit(1);
148+
146149
}
147150
catch(...){
148151
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!! "<<m_toolnames.at(i)<<" Failed to initialise (uncaught error)\n"<<std::endl;
@@ -221,7 +224,17 @@ int ToolChain::Execute(int repeates){
221224

222225
catch(std::exception& e){
223226
*m_log<<MsgL(0,m_verbose)<<red<<e.what()<<"\n"<<std::endl;
224-
throw;
227+
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!!! "<<m_toolnames.at(i)<<" Failed to execute (uncaught error)\n"<<std::endl;
228+
229+
result=2;
230+
if(m_errorlevel>0){
231+
if(m_recover){
232+
m_errorlevel=0;
233+
Finalise();
234+
}
235+
exit(1);
236+
}
237+
225238
}
226239
catch(...){
227240
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!!! "<<m_toolnames.at(i)<<" Failed to execute (uncaught error)\n"<<std::endl;
@@ -284,11 +297,15 @@ int ToolChain::Finalise(){
284297

285298
catch(std::exception& e){
286299
*m_log<<MsgL(0,m_verbose)<<red<<e.what()<<"\n"<<std::endl;
287-
throw;
300+
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!!!! "<<m_toolnames.at(i)<<" Finalised successfully (uncaught error)\n"<<std::endl;
301+
302+
result=2;
303+
if(m_errorlevel>0)exit(1);
304+
288305
}
289306
catch(...){
290307
*m_log<<MsgL(0,m_verbose)<<red<<"WARNING !!!!!!! "<<m_toolnames.at(i)<<" Finalised successfully (uncaught error)\n"<<std::endl;
291-
308+
292309
result=2;
293310
if(m_errorlevel>0)exit(1);
294311
}

0 commit comments

Comments
 (0)