Reply to comment

Error Handling Notes

Error messaging facility:


$errL = new ErrorListener();

global $errL;
...
$errL->add('context', 'message', $errCode);
...

if ($errL->hasErrors())
$errL->showAsHtml();

$errL->getError('context');

if ($errL->hasError('context'))
exit;

The listener would collect all error messages into an object, and provide methods to help display them.

It can also dispatch code:

$errL->addHandlerObject('context', &$objRef );

If an error is triggered with the key 'context', $objRef->errorHandler($errCode) is called.

Shortly after I wrote this note, a class at PHP Classes showed up that does something related: error_manager

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <p> <br> <div> <pre> <code> <img><h1><h2><h3><h4> <blockquote>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

.