TwiceAsNice
2019-02-18
|
When an error is detected libapogee logs the error, in the Windows Event Log or syslog, and then throws a std::runtime_exception. The exception's what() string contains a : delimited string with the following format, libapogee:location:Error Message:ErrorType.
Here is an example of a critical errror libapogee:.\win\GenTwoWinUSB.cpp(307):VND_APOGEE_STATUS failed with error 22:1. The ErrorType vaule matches the Apg::ErrorType enum. The following control flow diagram shows how to handle various error types.
Critical errors occur when there is a breakdown of communications between the host PC and the camera. When these error occur it is recommended to close the connection to the camera which will attempt to clear the IO errors. The calling application should then rescan the IO bus for the camera. If the camera is detected, then proceed with opening the camera and initializing it just like on start up.
Almost all serious error conditions can be resolved by calling ApogeeCam::Reset, which resets the camera's imaging pipeline. After calling this function the calling program should reinitalize the camera (ApogeeCam::Init) and then wait for the camera to enter the flushing state (Apg::Status_Flushing). Upon entering the flushing state, the camera is then ready to resume imaging operations.