Skip to content
Snippets Groups Projects
Commit 17c1d0d5 authored by Lorenzo Moneta's avatar Lorenzo Moneta Committed by Guilherme Amadio
Browse files

Fix ROOT-9611 by catching exception by reference

parent 42ad6fd9
No related branches found
No related tags found
No related merge requests found
...@@ -170,7 +170,7 @@ Long64_t TMVA::DataSet::GetNClassEvents( Int_t type, UInt_t classNumber ) ...@@ -170,7 +170,7 @@ Long64_t TMVA::DataSet::GetNClassEvents( Int_t type, UInt_t classNumber )
try { try {
return fClassEvents.at(type).at(classNumber); return fClassEvents.at(type).at(classNumber);
} }
catch (std::out_of_range) { catch (std::out_of_range &) {
ClassInfo* ci = fdsi->GetClassInfo( classNumber ); ClassInfo* ci = fdsi->GetClassInfo( classNumber );
Log() << kFATAL << Form("Dataset[%s] : ",fdsi->GetName()) << "No " << (type==0?"training":(type==1?"testing":"_unknown_type_")) Log() << kFATAL << Form("Dataset[%s] : ",fdsi->GetName()) << "No " << (type==0?"training":(type==1?"testing":"_unknown_type_"))
<< " events for class " << (ci==NULL?"_no_name_known_":ci->GetName()) << " (index # "<<classNumber<<")" << " events for class " << (ci==NULL?"_no_name_known_":ci->GetName()) << " (index # "<<classNumber<<")"
......
...@@ -633,7 +633,7 @@ Float_t TMVA::Reader::EvaluateRegression( UInt_t tgtNumber, const TString& metho ...@@ -633,7 +633,7 @@ Float_t TMVA::Reader::EvaluateRegression( UInt_t tgtNumber, const TString& metho
try { try {
return EvaluateRegression(methodTag, aux).at(tgtNumber); return EvaluateRegression(methodTag, aux).at(tgtNumber);
} }
catch (std::out_of_range) { catch (std::out_of_range &) {
Log() << kWARNING << "Regression could not be evaluated for target-number " << tgtNumber << Endl; Log() << kWARNING << "Regression could not be evaluated for target-number " << tgtNumber << Endl;
return 0; return 0;
} }
...@@ -699,7 +699,7 @@ Float_t TMVA::Reader::EvaluateMulticlass( UInt_t clsNumber, const TString& metho ...@@ -699,7 +699,7 @@ Float_t TMVA::Reader::EvaluateMulticlass( UInt_t clsNumber, const TString& metho
try { try {
return EvaluateMulticlass(methodTag, aux).at(clsNumber); return EvaluateMulticlass(methodTag, aux).at(clsNumber);
} }
catch (std::out_of_range) { catch (std::out_of_range &) {
Log() << kWARNING << "Multiclass could not be evaluated for class-number " << clsNumber << Endl; Log() << kWARNING << "Multiclass could not be evaluated for class-number " << clsNumber << Endl;
return 0; return 0;
} }
......
...@@ -748,7 +748,7 @@ void TMVA::VariableGaussTransform::MakeFunction( std::ostream& fout, const TStri ...@@ -748,7 +748,7 @@ void TMVA::VariableGaussTransform::MakeFunction( std::ostream& fout, const TStri
if( type != 'v' ){ if( type != 'v' ){
Log() << kWARNING << "MakeClass for the Gauss transformation works only for the transformation of variables. The transformation of targets/spectators is not implemented." << Endl; Log() << kWARNING << "MakeClass for the Gauss transformation works only for the transformation of variables. The transformation of targets/spectators is not implemented." << Endl;
} }
}catch( std::out_of_range ){ }catch( std::out_of_range &){
Log() << kWARNING << "MakeClass for the Gauss transformation searched for a non existing variable index (" << ivar << ")" << Endl; Log() << kWARNING << "MakeClass for the Gauss transformation searched for a non existing variable index (" << ivar << ")" << Endl;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment