core/play/src/main/java/play/http/DefaultHttpErrorHandler.java
@Override
  public CompletionStage<Result> onClientError(
      RequestHeader request, int statusCode, String message) {
    if (statusCode == 400) {
      return onBadRequest(request, message);
    } else if (statusCode == 403) {
      return onForbidden(request, message);
    } else if (statusCode == 404) {
      return onNotFound(request, message);
    } else if (statusCode >= 400 && statusCode < 500) {
      return onOtherClientError(request, statusCode, message);
    } else {
      throw new IllegalArgumentException(
          "onClientError invoked with non client error status code " + statusCode + ": " + message);
    }
  }
@Override
  public CompletionStage<Result> onClientError(
      RequestHeader request, int statusCode, String message) {
    if (statusCode == 400) {
      return onBadRequest(request, message);
    } else if (statusCode == 403) {
      return onForbidden(request, message);
    } else if (statusCode == 404) {
      return onNotFound(request, message);
    } else if (statusCode >= 400 && statusCode < 500) {
      return onOtherClientError(request, statusCode, message);
    } else {
      throw new IllegalArgumentException(
          "onClientError invoked with non client error status code " + statusCode + ": " + message);
    }
  }
@ Override public CompletionStage < Result > onClientError ( RequestHeader request , int statusCode , String message ) { if ( statusCode == 400 ) { return onBadRequest ( request , message ) ; } else if ( statusCode == 403 ) { return onForbidden ( request , message ) ; } else if ( statusCode == 404 ) { return onNotFound ( request , message ) ; } else if ( statusCode >= 400 && statusCode < 500 ) { return onOtherClientError ( request , statusCode , message ) ; } else { throw new IllegalArgumentException ( "onClientError invoked with non client error status code " + statusCode + ": " + message ) ; } }
Invoked when a client error occurs, that is, an error in the 4xx series.

<p>The base implementation calls onBadRequest, onForbidden, onNotFound, or onOtherClientError
depending on the HTTP status code.

@param request The request that caused the client error.
@param statusCode The error status code. Must be greater or equal to 400, and less than 500.
@param message The error message.
@return a CompletionStage containing the Result.
Invoked when a client error occurs that is an error in the 4xx series .