How can I deliver an error page in Slim framework when an Exception is thrown outside of a route?
问题 I'm trying to wrap my head around the order of operations for dealing with Exceptions thrown in a Slim framework app and the final page delivery. Basically, if I throw an Exception in a class I'd like Slim to deliver my pretty Twig 500 page, but I can't even get Slim to deliver its own normal error page when an exception is thrown outside of a route. Given this database class constructor: public function __construct(array $connection, \Slim\Slim $slim) { $this->slim = $slim; try { $this->db =