From: mivanov Date: Mon, 26 May 2014 10:02:02 +0000 (+0200) Subject: ATO-37 - STEER/CDB/AliOCDBtoolkit.cx - catch exception in case not valid OCDB entri... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=05f1b86c7fcd64defe8d52a44d6aae47a4c5dff6;p=u%2Fmrichter%2FAliRoot.git ATO-37 - STEER/CDB/AliOCDBtoolkit.cx - catch exception in case not valid OCDB entries for OCDB dump PWGPP/CalibMacros/AliOCDBtoolkit.sh enable core dumps by default --- diff --git a/PWGPP/CalibMacros/AliOCDBtoolkit.sh b/PWGPP/CalibMacros/AliOCDBtoolkit.sh index 87ce236abc8..2bc7f81c655 100644 --- a/PWGPP/CalibMacros/AliOCDBtoolkit.sh +++ b/PWGPP/CalibMacros/AliOCDBtoolkit.sh @@ -27,6 +27,7 @@ ocdbMakeTable(){ echo "Usage: $0 \$inputFile \$flag \$outputFile" return 1 fi + export ALIROOT_FORCE_COREDUMP=1 local inFile=${1} local inFlag=${2} local outFile=${3} @@ -61,6 +62,7 @@ dumpObject(){ # $3 type of the dump (XML or MI recursive dump ) # Output: # $4 output file name + export ALIROOT_FORCE_COREDUMP=1 if [ $# -lt 4 ] ; then echo "Usage: $0 \$inputFile \$object_name \$dump_type [XML/MI] \$outfile" return 1 @@ -107,6 +109,7 @@ diffObject(){ # $4 type of the dump (xml or MI recursive dump ) # Output: # $5 output diff file name + export ALIROOT_FORCE_COREDUMP=1 if [ $# -lt 5 ] ; then echo "Usage: $0 \$inputFile1 \$inputFile2 \$object_name \$dump_type [XML/MI] \$outfile" return 1 @@ -145,7 +148,7 @@ dumpOCDBDiffTable(){ # $2 - list 2 # Output: # difference is stdout - + export ALIROOT_FORCE_COREDUMP=1 list1=$1 list2=$2 shift 2 diff --git a/STEER/CDB/AliOCDBtoolkit.cxx b/STEER/CDB/AliOCDBtoolkit.cxx index d6e4caffa3d..8abfdb64ea4 100644 --- a/STEER/CDB/AliOCDBtoolkit.cxx +++ b/STEER/CDB/AliOCDBtoolkit.cxx @@ -173,6 +173,10 @@ void AliOCDBtoolkit::DumpOCDBAsTxt(const TString fInput, const TString fType, co } else if(fType.EqualTo("ESD",TString::kIgnoreCase)){ file = TFile::Open(fInput.Data()); + if (!file) { + printf("Input file does not exist %s. Exiting\n",fInput.Data()); + return; + } TList *listESD = ((TTree*)file->Get("esdTree"))->GetUserInfo(); cdbMap = (TMap*)listESD->FindObject("cdbMap"); if (!cdbMap){ @@ -470,8 +474,12 @@ void AliOCDBtoolkit::DumpOCDB(const TMap *cdbMap0, const TList *cdbList0, const if(!ostr) ostr = (TObjString*)cdbMap0->GetValue("default"); cdbPath = ostr->GetString(); if(cdbPath.Contains("local://"))cdbPath=cdbPath(8,cdbPath.Length()).Data(); - - cdbEntry = (AliCDBEntry*) man->Get(*CDBId,kTRUE); + try { + cdbEntry = (AliCDBEntry*) man->Get(*CDBId,kTRUE); + }catch(const exception &e){ + cerr << "OCDB retrieval failed!" << endl; + cerr << "Detailes: " << e.what() << endl; + } if (!cdbEntry) { printf("Object not avaliable\n"); CDBId->Print();