Exception handling inside core calibrator class
Summary
Need to have common method for exception handling inside the core calibrator
class.
1. Figure out all possible exceptions
-
Optical throughput:
- FailedThroughputCalibration (can be as parent or for any unexpected case)
- CorruptedMuonData (problems with input data):
- No muons at all
- Not enough good muons
- Bad format of the data
-
Atmospheric
- External agents are not available (server down, protocol/format changed, authentication error etc.)
- No Contemporary MDP
- Wrong time period configuration
- Lack of DAS data
- Discontinuity of weather/climate data
-
Camera Calibration
- Bad input data
- Not enough
- Bad quality
- CalibPipe fails to calculate for a nonnegligible N pixels
- Memory issue
- Bad input data
-
Related to DB and .ecsv table storage
- Database connection is not established
- DB table does not exist
- Not consistent container vs. DB table
- Other unexpected exception related to the
DB/ecsv
storage
2. Exceptions should have structure of the tree based on the type and severity
-
Type:
- Bad input data
- Bad config parameters
- Bad output
- Unable to store the output
-
Severity:
- Pipeline fails, can be relaunched with same data, other config
- Pipeline fails, can be relaunched with other data, same config
- Pipeline fails, can't be relaunched
- Pipeline fails, should be used alternative method
exit_status
) for each of the above mentioned options
3. Need to decide on the exit code value (4. Logic of whole procedure, from generating exception to the finishing of the program with the appropriate exit code:
- Exception should be generated inside the
calibrate
method, processed in thehandle_exception
method and transferred asexit_status
value to thetool
, where we have inherited methodself.exit(exit_status)
that will be received by the Workload