Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

MetalGuardian/yii-ratchet-error-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ratchet Error Handler

Error handler with handling php errors, exceptions,. fatal errors

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require metalguardian/yii-ratchet-error-handler "dev-master"

or add

"metalguardian/yii-ratchet-error-handler": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your configuration file :

array(
    'preload' => array(
        // ...
        'rollbar',
        // ...
    ),
    'components' => array(
        'rollbar' => array(
            'class' => '\metalguardian\rollbar\Component',
            'access_token' => 'ACCESS_TOKEN',
            'environment' => 'production',
            'included_errno' => E_ALL,
        ),
        'errorHandler' => array(
            'class' => '\metalguardian\rollbar\ErrorHandler',
            'ignoreException' => function ($exception) {
                /** @var \CHttpException $exception */
                // ignore 404 exceptions
                if ($exception instanceof \CHttpException && $exception->statusCode == 404) {
                    return true;
                }
                // ignore 403 exceptions
                if ($exception instanceof \CHttpException && $exception->statusCode == 403) {
                    return true;
                }
                // other ignores

                return false;
            },
        ),

        ),
    // ...
)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages