With the exception of:
- HoneyClient::Manager::VM
- HoneyClient::Agent::Driver
- HoneyClient::Util::SOAP
- HoneyClient::Util::Config
All other modules need additional error handling and reporting.
1. For local functions, this means:
- Replace all print statements with a $LOG->level($msg) call, where level is debug, info, warn, error, or fatal for all respective messages
- Once the corresponding message has been logged,
- For fatal and error messages: use Carp::croak($msg)
- For warnings: use Carp::carp($msg)
2. For remote SOAP calls on SOAP servers, this means:
- Replace all print statements with a $LOG->level($msg) call, where level is debug, info, warn, error, or fatal for all respective messages
- Once the corresponding message has been logged,
- For fatal messages: use Carp::croak($msg)
- For all other messages: use die SOAP::Fault()
Note: For multi-threaded SOAP functions, where faults may occur in an asynchronous operation, you need to develop a fault queuing system, such that the next asynchronous fault gets emitted when the next client makes a SOAP request.
This method is not completely ideal; however, it guarantees all faults will be reported back to a SOAP client, one fault per subsequent SOAP request. This is acceptable, since we only expect a SOAP server to service a single SOAP client. (We'll have to revisit this issue, if we ever have a SOAP server supporting multiple SOAP clients.)
For an example on how to implement this fault queuing system, see the _emitQueuedFault() and _queueFault() functions within the HoneyClient::Manager::VM package.
Note: Additional sub tickets will be opened, as this issue gets resolved on a per-package basis.