Skip to content

Commit

Permalink
Merge pull request #2678 from RosettaCommons/sergey/f2
Browse files Browse the repository at this point in the history
Refactoring Rosetta exceptions classes. 

Old repository SHA1: a995eac28418df1f27dd3e6f9ff094c7b6bf2642
  • Loading branch information
lyskov authored Nov 17, 2017
1 parent 4e75641 commit 8378a19
Show file tree
Hide file tree
Showing 1,882 changed files with 4,263 additions and 4,475 deletions.
2 changes: 1 addition & 1 deletion .benchmark-signature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
81ed0ca0949fbf6f613a627b76ff8d6320c25377
dd6176ec1d007b675bcb4cbf88202e3fe5318817
5 changes: 3 additions & 2 deletions source/external/cxxtest/cxxtestgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ def writePreamble( output ):
output.write( "#include <cxxtest/%s.h>\n" % gui )
output.write( "\n" )
output.write( "//catch unhandled exceptions in unit tests\n" )
output.write( "#include <utility/excn/EXCN_Base.hh>\n" )
output.write( "#include <utility/excn/Exceptions.hh>\n" )
output.write( "#include <cassert>\n" )
wrotePreamble = 1

def writeMain( output ):
Expand Down Expand Up @@ -459,7 +460,7 @@ def writeMain( output ):
output.write( ' CxxTest::initialize();\n' )
output.write( ' try{\n' )
output.write( ' return CxxTest::%s().run();\n' % runner )
output.write( ' } catch( utility::excn::EXCN_Base& excn ) {\n' )
output.write( ' } catch( utility::excn::Exception& excn ) {\n' )
output.write( ' std::cerr\n' )
output.write( ' << "ERROR: Unhandled Exception caught by cxxtest: "\n' )
output.write( ' << excn << std::endl;\n' )
Expand Down
6 changes: 3 additions & 3 deletions source/src/apps/benchmark/performance/ScoreEach.bench.hh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public:
core::scoring::methods::EnergyMethodOptions opts;
try {
enmeth_ = core::scoring::ScoringManager::get_instance()->energy_method( score_type_, opts );
} catch (utility::excn::EXCN_Base& excn){
} catch (utility::excn::Exception& excn){
TR.Error
<< "Unable to Test scoring with score type '"
<< core::scoring::ScoreTypeManager::name_from_score_type(score_type_)
Expand All @@ -100,7 +100,7 @@ public:
<< "' gives zero energy with test structure. Timing values may not be informative." << std::endl;
}
setup_successful_ = true;
} catch (utility::excn::EXCN_Base& excn){
} catch (utility::excn::Exception& excn){
TR.Error
<< "Unable to Test scoring with score type '"
<< core::scoring::ScoreTypeManager::name_from_score_type(score_type_)
Expand Down Expand Up @@ -137,7 +137,7 @@ public:
pose_->energies().clear();
scorefxn.set_weight(score_type_, 0);
}
} catch (utility::excn::EXCN_Base& excn){
} catch (utility::excn::Exception& excn){
TR.Error
<< "Unable to Test scoring with score type '"
<< core::scoring::ScoreTypeManager::name_from_score_type(score_type_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ int main( int argc, char *argv[])

// Do not adjust this line without altering the daemon code because it will look for it as signal of normal ending!
TR << "Performance Benchmark ended. --------------------------------" << std::endl;
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cerr << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/benchmark/scientific/ddg_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ main( int argc, char * argv [] )
correlation(ddg_out);
exit(0);

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ int main( int argc, char * argv [] )
statistics(sqc_file);
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cerr << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
8 changes: 4 additions & 4 deletions source/src/apps/benchmark/scientific/rotamer_recovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <core/scoring/ScoreFunctionFactory.hh>

// Utility Headers
#include <utility/excn/EXCN_Base.hh>
#include <utility/excn/Exceptions.hh>
#include <utility/excn/Exceptions.hh>
#include <utility/exit.hh>
#include <utility/vector0.hh>
Expand All @@ -59,7 +59,7 @@ using protocols::rotamer_recovery::RotamerRecoveryFactory;
using protocols::rotamer_recovery::RotamerRecoveryMover;
using protocols::rotamer_recovery::RotamerRecoveryMoverOP;
using protocols::jd2::JobDistributor;
using utility::excn::EXCN_Base;
using utility::excn::Exception;

static Tracer TR("apps.benchmark.scientific.rotamer_recovery");

Expand Down Expand Up @@ -136,15 +136,15 @@ main( int argc, char * argv [] )
rotamer_recovery_mover->show( fout );
fout.close();
}
} catch (EXCN_Base & excn ) {
} catch (Exception & excn ) {
TR.Error << "Exception: " << endl;
excn.show( TR.Error );

TR << "Exception: " << endl;
excn.show( TR ); //so its also seen in a >LOG file
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/amelie/design_tight_clusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ int main( int argc, char * argv [] )
//score_fxn->show(TR, p);


} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/amelie/detect_tight_clusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ int main( int argc, char * argv [] )
//score_fxn->show(TR, p);


} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andre/SymmDataTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ main( int argc, char * argv [] )
devel::init( argc, argv );

protocols::viewer::viewer_main( my_main );
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/analyze_rtmin_failures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int main( int argc, char * argv [] )
(*sfxn)(pose);
pose.dump_pdb( "rtmin_failure_best_nonnative_rotamer.pdb" );
}
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/apl_msd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int main( int argc, char ** argv )
break;
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/domain_assembly_jd2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main( int argc, char * argv [] )
// GO!
protocols::jd2::JobDistributor::get_instance()->go( mover );

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/find_buns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main( int argc, char * argv [] )
std::string outname = inputname.base();
write_buns_and_dots_kinemage( outname + "_buried_unsats.kin", outname, pose, rotamer_dots, buns );
}
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/fixbb_jd3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ main( int argc, char * argv [] )
protocols::jd3::JobQueenOP queen( new FixbbJobQueen );
//std::cout << "Fixbb job definition file\n" << queen->job_definition_xsd() << std::endl;
jd->go( queen );
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/flex_regions_alc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int main( int argc, char * argv [] )
++ii;
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
24 changes: 12 additions & 12 deletions source/src/apps/pilot/andrew/interface_ddg_bind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ InterfaceDDGBindJobInputter::fill_jobs( protocols::jd2::JobsContainer & jobs )
utility::io::izstream ddg_jobs( jobfname );
if ( ! ddg_jobs.good() ) {
// could not open jobs file
throw utility::excn::EXCN_Msg_Exception( "Could not open interface ddg jobs file: '" + jobfname );
throw CREATE_EXCEPTION(utility::excn::Exception, "Could not open interface ddg jobs file: '" + jobfname );
}

typedef std::pair< std::string, std::string > PDBAndSeqposPair;
Expand All @@ -504,34 +504,34 @@ InterfaceDDGBindJobInputter::fill_jobs( protocols::jd2::JobsContainer & jobs )
sstream >> pdb;
if ( ! sstream.good() ) {
// throw an exception
throw utility::excn::EXCN_Msg_Exception( "Problem reading '" + jobfname + "' on line " +
throw CREATE_EXCEPTION(utility::excn::Exception, "Problem reading '" + jobfname + "' on line " +
utility::to_string( count_line ) + ", which reads:\n" + line );
}
sstream >> chain;
if ( ! sstream.good() ) {
// throw an exception
throw utility::excn::EXCN_Msg_Exception( "Problem reading '" + jobfname + "' on line " +
throw CREATE_EXCEPTION(utility::excn::Exception, "Problem reading '" + jobfname + "' on line " +
utility::to_string( count_line ) + ", which reads:\n" + line );
}
if ( chain.size() != 1 ) {
throw utility::excn::EXCN_Msg_Exception( "Expected to read a chain identifier (or an underscore) "
throw CREATE_EXCEPTION(utility::excn::Exception, "Expected to read a chain identifier (or an underscore) "
"after reading the pdb name in file '" + jobfname + "' on line " +
utility::to_string( count_line ) + ", which reads:\n" + line );
}
sstream >> resstring;
if ( ! sstream.good() ) {
// throw an exception
throw utility::excn::EXCN_Msg_Exception( "Problem reading '" + jobfname + "' on line " +
throw CREATE_EXCEPTION(utility::excn::Exception, "Problem reading '" + jobfname + "' on line " +
utility::to_string( count_line ) + ", which reads:\n" + line );
}
sstream >> newaa;
if ( ! sstream.good() ) {
// throw an exception
throw utility::excn::EXCN_Msg_Exception( "Problem reading '" + jobfname + "' on line " +
throw CREATE_EXCEPTION(utility::excn::Exception, "Problem reading '" + jobfname + "' on line " +
utility::to_string( count_line ) + ", which reads:\n" + line );
}
if ( ! core::chemical::oneletter_code_specifies_aa( newaa ) ) {
throw utility::excn::EXCN_Msg_Exception( "Could not interpret the input character '" +
throw CREATE_EXCEPTION(utility::excn::Exception, "Could not interpret the input character '" +
utility::to_string( newaa ) + "' as an amino acid 1-letter code.\n" + "Problem encountered on line " +
utility::to_string( count_line ) + " of file " + jobfname + " which reads " + line );
}
Expand All @@ -546,8 +546,8 @@ InterfaceDDGBindJobInputter::fill_jobs( protocols::jd2::JobsContainer & jobs )
int resid; char insertion_code;
try {
core::pose::parse_PDBnum_icode( resstring, jobfname, count_line, resid, insertion_code );
} catch ( utility::excn::EXCN_Msg_Exception e ) {
throw utility::excn::EXCN_Msg_Exception( "Could not interpret the string '" + resstring + "' as a residue identifier\n" + e.msg() );
} catch (utility::excn::Exception e ) {
throw CREATE_EXCEPTION(utility::excn::Exception, "Could not interpret the string '" + resstring + "' as a residue identifier\n" + e.msg() );
}
input_mutation mutation;
mutation.resind = core::pose::ResidueIndexDescriptionFromFileOP(
Expand All @@ -568,7 +568,7 @@ InterfaceDDGBindJobInputter::fill_jobs( protocols::jd2::JobsContainer & jobs )
} else {
std::string existing_pdb = base_names[ iibase ];
if ( existing_pdb != iipdb ) {
throw utility::excn::EXCN_Msg_Exception( "Two different PDBs, '" + existing_pdb + "' and '" +
throw CREATE_EXCEPTION(utility::excn::Exception, "Two different PDBs, '" + existing_pdb + "' and '" +
iipdb + " have the same base name, '" + iibase + "' and so the output structure names will collide." +
"\nPlease rename one of them." );
}
Expand Down Expand Up @@ -610,7 +610,7 @@ InterfaceDDGBindJobInputter::fill_jobs( protocols::jd2::JobsContainer & jobs )
}
}
} else {
utility::excn::EXCN_Msg_Exception( "InterfaceDDGJobInputter requires the interface_ddg::jobs flag" );
throw CREATE_EXCEPTION(utility::excn::Exception, "InterfaceDDGJobInputter requires the interface_ddg::jobs flag" );
}

for ( std::list< InterfaceDDGBindInnerJobOP >::const_iterator
Expand Down Expand Up @@ -752,7 +752,7 @@ int main( int argc, char * argv [] )

protocols::jd2::JobDistributor::get_instance()->go( iddgm, protocols::jd2::JobInputterOP( new InterfaceDDGBindJobInputter ));

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/kellogg_ddg_jd3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ main( int argc, char * argv [] )
protocols::jd3::JobQueenOP queen( new FixbbJobQueen );
//std::cout << "Fixbb job definition file\n" << queen->job_definition_xsd() << std::endl;
jd->go( queen );
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/measure_catalytic_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main( int argc, char * argv [] )
std::cout << "ANG U1D2 " << numeric::constants::d::radians_to_degrees * numeric::angle_radians( vu1, vd1, vd2 ) << std::endl;
std::cout << "DIS U1D1 " << vu1.distance( vd1 ) << std::endl;

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int main( int argc, char * argv [] )
}
std::cout << "Max D for " << iirot->name() << " " << std::sqrt(maxd2) << std::endl;
}
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/mmt_msd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ int main( int argc, char ** argv )
mmt_receiver.main_optimization_loop();
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions source/src/apps/pilot/andrew/mpi_msd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int main( int argc, char ** argv )
utility::io::izstream daf_file( daf_filename );
try {
daf->initialize_from_input_file( ds, daf_file );
} catch ( utility::excn::EXCN_Msg_Exception & e ) {
} catch (utility::excn::Exception & e ) {
std::cerr << "Caught exception" << std::endl;
std::cerr << e.msg() << std::endl;
exit(1);
Expand Down Expand Up @@ -324,7 +324,7 @@ int main( int argc, char ** argv )
MPI_Finalize();
#endif

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/mpi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int main( int argc, char ** argv )
TR << "Node " << mpi_rank() << " recieved a single double " << receive_double_from_node( 0 ) << std::endl;
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/relax_jd3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ main( int argc, char * argv [] )
protocols::jd3::JobQueenOP queen( new RelaxJobQueen );
//std::cout << "Fixbb job definition file\n" << queen->job_definition_xsd() << std::endl;
jd->go( queen );
} catch ( utility::excn::EXCN_Base const & e ) {
} catch ( utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/sweep_respair_energies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ int main( int argc, char * argv [] )
db_session->commit();
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cerr << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/version_scorefunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int main( int argc, char ** argv )
}
}

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/andrew/zn_match_symmdock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int main( int argc, char * argv [] )
// GO!
protocols::jd2::JobDistributor::get_instance()->go( seq_mover );

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/aroop/model_e2c_ubiquitin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ main( int argc, char * argv [] )
MoverOP e2ubdock = new ub_e2c::ubi_e2c_modeler();
protocols::jobdist::main_plain_mover( *e2ubdock );

} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion source/src/apps/pilot/arubenstein/sequence_tolerance_mf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ main( int argc, char * argv[] )
NEW_OPT(seq_tol::surface, "calculate the the surface score", false);
devel::init( argc, argv );
protocols::viewer::viewer_main( sequence_tolerance_mf_main );
} catch ( utility::excn::EXCN_Base const & e ) {
} catch (utility::excn::Exception const & e ) {
std::cout << "caught exception " << e.msg() << std::endl;
}
return 0;
Expand Down
Loading

0 comments on commit 8378a19

Please sign in to comment.