Skip to content

Instantly share code, notes, and snippets.

@jackmakiyama
Created June 26, 2013 23:10
Show Gist options
  • Save jackmakiyama/5872583 to your computer and use it in GitHub Desktop.
Save jackmakiyama/5872583 to your computer and use it in GitHub Desktop.
Respect exceptionRoute
<?php
use Respect\Rest\Router;
require_once 'vendor/autoload.php';
// Routes
$router = new Router('/public');
$router->any('/', 'Teste ok');
$router->any('/**', function(){
throw new RuntimeException();
});
$router->exceptionRoute('RuntimeException', function($e) {
return 'Caught a Gotcha!';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment