HTML_Progress2 : The Definitive Guide |
Table of Contents
After many rewrites, the new error management adding to this major version of HTML_Progress2 provides again more than in branch 1.x
The HTML_Progress2 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_Progress2 API error (basic or
exception) will raise a HTML_Progress2_Error
object that will be return to
call script (user script).
Note | |
---|---|
In HTML_Progress 1.x each API error returns a basic
PEAR_Error object.
|
Tip | |
---|---|
Easy to distinct basic PEAR_Error from other PEAR packages to
HTML_Progress2 errors, even if there is a better and more
robust solution: HTML_Progress2::hasErrors() . But also
provide a unique way to retrieve the level of progress error
(warning, error, exception) with the HTML_Progress2_Error::getLevel() method.
|
As usual, to check an error, you can use the PEAR error API :
as well as with :
which provide a portable solution, and output to screen will give something like :
Exception: invalid input, parameter #1 "$val" was expecting "integer", instead got "string" in html_progress2->setvalue (file [path_to]\[filename] on line 6)
Perhaps this standard behavior is not what you want. Don't worry, you can change everything :
Important | |
---|---|
HTML_Progress2 obey at display_errors and log_errors protocol, while HTML_Progress 1.x obey at error_reporting protocol. |
HTML_Progress2 : The Definitive Guide | v 2.4.0 : April 20, 2007 |