Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a problem we had where users inserted payloads where the creation of the path for the file failed since the user did not have write permission. The resulting entry in the cdb brought everything to a screeching halt since it checks if all calibrations exist. This result then in misleading error messages where you load a given calibration but the error mentions a completely different one. E.g. with our interface, trying to read the Centrality calibration:
getCalibration("Centrality",120000)
results in
BaseException: Could not find payload <cemc_PDC_ResidualCorr/41/ab/41ab0d98bff8206763951a48d3461252_pdc_res_e_eta.root> in any of the following read dirs: /cvmfs/sphenix.sdcc.bnl.gov/calibrations/sphnxpro/cdb/ /sphenix/cvmfscalib/sphnxpro/cdb/"
which made us look into parsing problems to see how Centrality changes to cemc_PDC_ResidualCorr
Now it will throw a BaseException if the creation of the directory or the file copying fails. This PR sits on top of the recent ntry PR since both affect the nopayloadclient.cpp
THe main technical change is swapping the order of inserting a calibration and writing it. In the original version the calibration was inserted and then the file was copied. If one wants to catch a write error the writing has to be done before inserting the calibration