This package is abandoned and no longer maintained. The author suggests using the package instead.

Beauty-exceptions plugin for Phalcon

dev-master 2016-08-20 18:29 UTC

This package is not auto-updated.

Last update: 2017-03-16 20:27:25 UTC


DEPRECATED Use Phalcon\Debug instead:

Phalcon is a web framework delivered as a C extension providing high performance and lower resource consumption.

Pretty Exceptions is an utility to show exceptions/errors/warnings/notices using a nicely visualization.

This utility is not intended to be used in a production stage.

This utility catches uncatched exceptions, remember to remove any try/catch that avoid the utility can work.

The code in this repository is written in PHP.

Automatic Usage

The easiest way to use this utility is include its 'loader':

require '/path/to/pretty-exceptions/loader.php';

Manual include

Or you could include the utility manually or via an autoloader:

//Requiring the file
require '/path/to/pretty-exceptions/Library.php';

//Or using an autoloader
$loader = new Phalcon\Loader();

        'Phalcon\\Utils' => '/path/to/pretty-exceptions/Library/Phalcon/Utils/'



Listen for exceptions:

    $p = new \Phalcon\Utils\PrettyExceptions();
    return $p->handle($e);

Listen for user errors/warnings/notices:

set_error_handler(function($errorCode, $errorMessage, $errorFile, $errorLine)
    $p = new \Phalcon\Utils\PrettyExceptions();
    return $p->handleError($errorCode, $errorMessage, $errorFile, $errorLine);


The following is the way to configure the utility:

$p = new \Phalcon\Utils\PrettyExceptions();

//Change the base uri for static resources

//Set if the backtrace must be shown

//Set whether if open the user files and show its code

//Set whether show the complete file or just the relevant fragment

 * Set whether show human readable dump of current Phalcon application instance
 *  Can optionally pass a Phalcon application instance as a parameter in the
 *  constructor, or as the last parameter of PrettyExceptions::handle() and
 *  PrettyExceptions::handleError()

//Change the CSS theme (default, night or minimalist)

//Handle the error/exception