The errorPage methods sets a handler for either an HTTP 404 Not Found error, or an HTTP 500 Internal Server error. The first argument is the error that should be caught, and the second argument is the function that should be called upon it being thrown.
For example:
zimki.errorPage(404, function( page ) { return "page " + page + " not found." } );
In the case of an error 500, a second argument is provided to the callback, which is the actual error that has been thrown:
function forceError () {
throw "we wanted to see what an error looked like!";
}
zimki.errorPage(500, function ( page, error ) { return "internal server error: " + error });
zimki.publishPath( '/error', forceError );
Parent
zimki
|