Ticket #23 (new improvement)

Opened 2 years ago

Last modified 6 months ago

Improve error handling and reporting across all packages

Reported by: kindlund Assigned to: kindlund
Priority: low Milestone: 1.1
Component: Unknown Version: none
Severity: none Keywords: error, handling, reporting, fault
Cc:

Description

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.

Attachments

Change History

11/05/06 05:47:05 changed by kindlund

If local error/fault handling ever gets extremely complex, then we may want to use the Object Orient Exception handling that is described in this report: http://www.perl.com/pub/a/2002/11/14/exception.html

We're not using anything this complex, for now, as SOAP::Fault provides an acceptable degree of usability for remote fault handling.

03/04/08 10:47:34 changed by kindlund

  • milestone changed from 1.0 to 1.1.

We'll have to work on this in later versions of the code, once we stabilize the core languages used.


Add/Change #23 (Improve error handling and reporting across all packages)




Change Properties
Action