Skip to content

Commit

Permalink
Update error creation when GRID CDB entry is missing: throw an except…
Browse files Browse the repository at this point in the history
…ion as AliCDBLocal does instead of a fatal error. This enables a uniform handling of missing CDB entries for local and grid OCDB.
  • Loading branch information
davidrohr authored and dberzano committed Aug 13, 2016
1 parent f9e7850 commit 7f8407e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions STEER/CDB/AliCDBGrid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -477,23 +477,30 @@ AliCDBEntry* AliCDBGrid::GetEntry(const AliCDBId& queryId) {

AliCDBId* dataId = GetEntryId(queryId);

TString errMessage(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));

if (!dataId){
AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
AliError(Form("No file found matching this id!"));
throw std::runtime_error(errMessage.Data());
return NULL;
}

TString filename;
if (!IdToFilename(*dataId, filename)) {
AliDebug(2,Form("Bad data ID encountered! Subnormal error!"));
delete dataId;
AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
throw std::runtime_error(errMessage.Data());
return NULL;
}

AliCDBEntry* anEntry = GetEntryFromFile(filename, dataId);

delete dataId;
if(!anEntry)
AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
if(!anEntry) {
AliError(Form("Error getting CDB Entry from file"));
throw std::runtime_error(errMessage.Data());
return NULL;
}

return anEntry;
}
Expand Down

0 comments on commit 7f8407e

Please sign in to comment.