For the backend of my new SPA, I want to easily transfer errors to the interface using special error and exception handlers.
I can add a custom error handler to the slim framework, for example:
$app->error(function (Exception $e) use ($app) {
}
This, however, does not lead to fatal errors. I also define a default global error handler that captures fatal errors if they occur outside the Slim context.
set_error_handler(function() {
echo "Huston we got a problem";
die();
});
This handler receives a fine message when I do this:
require "asdasd.php";
$app->get("/test", $authenticate, function () use ($app) {
});
but not when I do this:
$app->get("/test", $authenticate, function () use ($app) {
require "asdasd.php";
});
The last demo actually seems to start the default php error handler.
- , Slim, , forplevel, Slims ?