core/play/src/main/java/play/http/DefaultHttpErrorHandler.java
protected CompletionStage<Result> onNotFound(RequestHeader request, String message) {
    if (environment.isProd()) {
      return CompletableFuture.completedFuture(
          Results.notFound(
              views.html.defaultpages.notFound.render(
                  request.method(), request.uri(), request.asScala())));
    } else {
      return CompletableFuture.completedFuture(
          Results.notFound(
              views.html.defaultpages.devNotFound.render(
                  request.method(), request.uri(), Some.apply(routes.get()), request.asScala())));
    }
  }
protected CompletionStage<Result> onNotFound(RequestHeader request, String message) {
    if (environment.isProd()) {
      return CompletableFuture.completedFuture(
          Results.notFound(
              views.html.defaultpages.notFound.render(
                  request.method(), request.uri(), request.asScala())));
    } else {
      return CompletableFuture.completedFuture(
          Results.notFound(
              views.html.defaultpages.devNotFound.render(
                  request.method(), request.uri(), Some.apply(routes.get()), request.asScala())));
    }
  }
Invoked when a handler or resource is not found.

<p>If the environment's mode is production, then returns Results.notFound (404) with the
included template from `views.html.defaultpages.notFound` as the content.

<p>Otherwise, Results.notFound (404) is rendered with {@code
views.html.defaultpages.devNotFound} template.

@param request The request that no handler was found to handle.
@param message A message, which is not used by the default implementation.
@return a CompletionStage containing the Result.