Introduction

The HTML_CSS package is implemented with a flexible error handler
plug-in system. You may use any error handler that you want. Using
PEAR_Error object (default), but also the
PEAR_ErrorStack package, or any other error
handler you might want to plug in.

Without any configuration, each HTML_CSS API error (basic or exception)
will raise a HTML_CSS_Error object that will
be return to call script (user script).

Tip:
Easy to distinct basic PEAR_Error from other PEAR packages to HTML_CSS errors,
even if there is a better and more robust solution:
HTML_CSS::isError().
But also provide a unique way to retrieve the level of error (warning, error,
exception) with the HTML_CSS_Error::getLevel() method.

With push_callback option, you can decides to
stop script execution (as done with exceptions by default:
returns PEAR_ERROR_DIE constant), or continue
without filtering (returns NULL).

If you want to write your own callback function for the push_callback
option, this one should have two arguments: first one will get the error code,
and second will get error level. These are all the necessary informations to do
a filtering. Example that follow show how to be aware that a script use wrong argument data type.

Error Context Display

In some cases, you may want to customize error generation. For instance,
for each error (basic/exception), it is useful to include file, line number,
and class/function context information in order to trace it. The default
option will be sufficient for most cases but you want perhaps customize the
output format (render) of context information.

Note:
To have both display and log output, check the php.inidisplay_errors and log_errors values :
must be set to TRUE.

Let review, step by step, how to get such results.

Remember that with default classes, there are two drivers :
display and log that have both
their own configuration parameters.
You can override these parameters values with the handler
entry in the hash of second argument of the HTML_CSS class constructor.

We did it here with the $prefs variable; it's a two key
associative array. First key display defines the display driver
values, and the second key log defines the log driver values.