You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know, when placing the Middleware call into my src/middleware.php file, it will automatically replace Slim's error message with Whoops (haven't tested yet). But sometimes, I run into trouble with PHP errors.
Is there a way to replace them with Whoops too? If so, how? Haven't found it anywhere.
EDIT: Tried the rest, to see if the Error Handler is replaced, but it's not. Doing it like so: $app->response()->status(500);
This is my public/index.php file:
<?php
require __DIR__ . '/../vendor/autoload.php';
session_start();
// Instantiate the app
$settings = require __DIR__ . '/../src/settings.php';
$app = new \Slim\App($settings);
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __DIR__ . '/../src/routes.php';
// Run app
$app->run();
In the src/middleware.php is the Middleware call as in the Readme $app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware($app));.
The text was updated successfully, but these errors were encountered:
In this stage, the middleware only replaces the default errorHandler container only not phpErrorHandler. The phpErrorHandler is for PHP7.
And if your application breaks the lifecycle of slim middleware. it will not trigger this middleware that why you cannot see the whoop error. For example, the program throws an exception and without a handle.
Update on 2017-01-18 06:39:
Now, the middleware will replace the default errorHandler and phpErrorHandler.
If you want all errors/exceptions handle by whoops, you can use the global mode to install the whoops. this mode supports the program life cycle broken.
I know, when placing the Middleware call into my src/middleware.php file, it will automatically replace Slim's error message with Whoops (haven't tested yet). But sometimes, I run into trouble with PHP errors.
Is there a way to replace them with Whoops too? If so, how? Haven't found it anywhere.
EDIT: Tried the rest, to see if the Error Handler is replaced, but it's not. Doing it like so:
$app->response()->status(500);
This is my public/index.php file:
In the src/middleware.php is the Middleware call as in the Readme
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware($app));
.The text was updated successfully, but these errors were encountered: