HTTPErrorHandler { String errorHTML(Throwable e, String actionId) { String errorCode = e instanceof ErrorCode ? ((ErrorCode) e).errorCode() : "ERROR"; return "<html><body><h1>" + errorCode + "</h1><p>" + e.getMessage() + "</p><p>id: " + actionId + "</p></body></html>"; } HTTPErrorHandler(ResponseHandler responseHandler);  public ErrorHandler customErrorHandler; }
@Test void errorHTML() { String actionId = UUID.randomUUID().toString(); String html = handler.errorHTML(new Error("error message"), actionId); assertThat(html).contains("ERROR").contains("error message").contains(actionId); html = handler.errorHTML(new NotFoundException("not found"), actionId); assertThat(html).contains("NOT_FOUND").contains("not found").contains(actionId); }