nnfit does not handle write failures
Created by: Zaharid
As far as I can tell, something like this:
ofstream fitinfo(fitfilename.str().c_str());
fitinfo << fNIte <<" " << erf_val <<" "<<erf_trn<<" "<<chi2<<" ";
if (posVeto)
fitinfo << "POS_VETO"<<endl;
else
fitinfo << "POS_PASS"<<endl;
does nothing if there is a write failure other than set a status byte:
root [0] ofstream full("/dev/full")
(std::ofstream &) @0x7fb56f9e4020
root [1] full << "BAD WRITE";
# NOTE flush is important, otherwise we don't get any status
root [7] full.flush()
root [9] full.good()
(bool) false
I think we should handle these things somehow, by e.g. using this exception mechanism: