/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc7231">RFC 7231 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc7231">RFC 7231 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc7231">RFC 7231 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
/** * Simple test against an code to determine if it falls into the * <code>Client Error</code> message category as defined in the <a * href="http://tools.ietf.org/html/rfc1945">RFC 1945 - HTTP/1.0</a>, * and <a href="http://tools.ietf.org/html/rfc2616">RFC 2616 - * HTTP/1.1</a>. * * @return true if within range of codes that belongs to * <code>Client Error</code> messages. */ public boolean isClientError() { return HttpStatus.isClientError(this._code); }
private RuntimeException error(Request req, boolean uriIsSecret, Response res) { if (HttpStatus.isClientError(res.getStatus())) { switch (res.getStatus()) { case HttpStatus.REQUEST_TIMEOUT_408: case HttpStatus.TOO_MANY_REQUESTS_429: // Retry these. return new RuntimeException("Failed HTTP request: " + requestStatus(req, res, uriIsSecret)); default: // 4xx: The request is invalid for this resource. Fail hard without retrying. return new TaskExecutionException("HTTP 4XX Client Error: " + requestStatus(req, res, uriIsSecret)); } } else if (res.getStatus() >= 500 && res.getStatus() < 600) { // 5xx: Server Error. This is hopefully ephemeral. return ephemeralError("HTTP 5XX Server Error: " + requestStatus(req, res, uriIsSecret)); } else { // Unknown status code. Treat as an ephemeral error. return ephemeralError("Unexpected HTTP status: " + requestStatus(req, res, uriIsSecret)); } }