protected Error prepareError ( int statusCode , RouteContext routeContext ) { String messageKey = "pippo.statusCode" + statusCode ; Error error = new Error ( ) ; error . setStatusCode ( statusCode ) ; error . setStatusMessage ( application . getMessages ( ) . get ( messageKey , routeContext ) ) ; error . setRequestMethod ( routeContext . getRequestMethod ( ) ) ; error . setRequestUri ( routeContext . getRequestUri ( ) ) ; error . setStacktrace ( routeContext . getLocal ( STACKTRACE ) ) ; error . setMessage ( routeContext . getLocal ( MESSAGE ) ) ; return error ; }
Prepares an Error instance for the error response .