I am working with global object in Playframework. I've already created methods:
Users/edit/t
. Method to edit user expects f.e. integer. It can't handle stringI've created method onError:
public Promise<SimpleResult> onError(RequestHeader request, Throwable t) {
Logger.error("Request: " + request + "generated error: " + t.toString());
return Promise.<SimpleResult>pure(internalServerError(
views.html.errorPage.render("500", "Errors occured")
));
}
But I would like to test it. Please tell me how can I invoke this method to test it?
Create entry in routes file:
GET /testOnError controllers.ErrorController.testOnError
Error controller:
public static Result testOnError() {
throw new IllegalArgumentException();
}
Navigate to:
http://HOST:PORT/testOnError