Welcome Guest, Not a member yet? Register   Sign In
Using Whoops Error Handler
#1

Hi,

I've manage to installed Whoops in CI 3 using composer, with addition to index.php like so.

Code:
switch (ENVIRONMENT)
{
    case 'development':
        error_reporting(-1);
        ini_set('display_errors', 1);
        error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);

        $whoops = new \Whoops\Run;
        $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
        $whoops->register();

                throw new Exception('whoops handler test'); // For testing purpose
        break;

    case 'testing':
                // Omitted
        break;

    case 'production':
                // Omitted
        break;

    default:
                // Omitted
        exit(1);
}

It works when there is an error or exception in index.php, but when error occurred in Controller or Model. CI standard error handler is still used, anyone ever successfully installed Whoops?
Reply
#2

CodeIgniter replaces the error handler with it's own.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Is there a way to disable CI error handler?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB