]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ATO-37 - STEER/CDB/AliOCDBtoolkit.cx - catch exception in case not valid OCDB entri...
authormivanov <marian.ivanov@cern.ch>
Mon, 26 May 2014 10:02:02 +0000 (12:02 +0200)
committerhristov <Peter.Hristov@cern.ch>
Thu, 29 May 2014 14:36:04 +0000 (16:36 +0200)
          PWGPP/CalibMacros/AliOCDBtoolkit.sh enable core dumps by default

PWGPP/CalibMacros/AliOCDBtoolkit.sh
STEER/CDB/AliOCDBtoolkit.cxx

index 87ce236abc806da84166ac11322387681f70297a..2bc7f81c655e1c21bdab43146497299f7e51fc30 100644 (file)
@@ -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
index d6e4caffa3dda23c76ee6eee59ac5b53682ff44a..8abfdb64ea49ea924f46385dcfef924c6b18cb3e 100644 (file)
@@ -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();