Pass error code to response

Otherwise errors just get passed with code 200, which is bad for SEO etc.

Maybe you should consider making 500 the default, instead of 404? And perhaps return the 403/404 views, instead of errors in debug (so you can test the views easier, and 403/404 are pretty much self explainatory)