{@inheritDoc}

@see jcifs.internal.smb2.ServerMessageBlock2#isErrorResponseStatus()
493897
@Override
    protected boolean isErrorResponseStatus () {
        int status = getStatus();
        return status != NtStatus.NT_STATUS_INVALID_PARAMETER
                && ! ( status == NtStatus.NT_STATUS_INVALID_PARAMETER
                        && ( this.ctlCode == Smb2IoctlRequest.FSCTL_SRV_COPYCHUNK || this.ctlCode == Smb2IoctlRequest.FSCTL_SRV_COPYCHUNK_WRITE ) )
                && ! ( status == NtStatus.NT_STATUS_BUFFER_OVERFLOW && ( this.ctlCode == Smb2IoctlRequest.FSCTL_PIPE_TRANSCEIVE
                        || this.ctlCode == Smb2IoctlRequest.FSCTL_PIPE_PEEK || this.ctlCode == Smb2IoctlRequest.FSCTL_DFS_GET_REFERRALS ) )
                && super.isErrorResponseStatus();
    }
321054
static public void captureReponseErrors(Object response, String errorMessage) throws Exception {
		if( null == response ) {
			throw new Exception("Capturing errors from null response");
		}
		if( false == (response instanceof JSONObject) ) {
			// Not an error
			return;
		}
		JSONObject obj = (JSONObject)response;
		if( JSONSupport.containsKey(obj,"error") ) {
			String serverMessage;
			try {
				serverMessage = obj.getString("error");
			} catch (Exception e) {
				serverMessage = "Unable to parse error response";
			}
			
			if( null == errorMessage ) {
				errorMessage = "Error returned by database: ";
			}
			throw new Exception(errorMessage+serverMessage);
		}
	}
1317394
def _raise_for_status(response):
    '''
    
    '''
    http_error_msg = ""

    if 400 <= response.status_code < 500:
        http_error_msg = "{0} Client Error: {1}".format(response.status_code,
                                                        response.reason)

    elif 500 <= response.status_code < 600:
        http_error_msg = "{0} Server Error: {1}".format(response.status_code,
                                                        response.reason)

    if http_error_msg:
        try:
            more_info = response.json().get("message")
        except ValueError:
            more_info = None
        if more_info and more_info.lower() != response.reason.lower():
            http_error_msg += ".\n\t{0}".format(more_info)
        raise requests.exceptions.HTTPError(http_error_msg, response=response)
1196116
def error_response(self, error, mimetype='application/json', status=400,
            **kwargs):
        
        return HttpResponse(json.dumps(error), mimetype=mimetype,
                status=status, **kwargs)
269652
private boolean isStatusCodeOK(Response response, String uri) {
		if (response.getStatus() == Status.OK.getStatusCode()
				|| response.getStatus() == Status.CREATED.getStatusCode()) {
			return true;
		} else if (response.getStatus() == Status.UNAUTHORIZED.getStatusCode()) {
			throw new NotAuthorizedException("UNAUTHORIZED: Your credentials are wrong. "
					+ "Please check your username/password or the secret key.", response);
		} else if (response.getStatus() == Status.CONFLICT.getStatusCode()
				|| response.getStatus() == Status.NOT_FOUND.getStatusCode()
				|| response.getStatus() == Status.FORBIDDEN.getStatusCode()
				|| response.getStatus() == Status.BAD_REQUEST.getStatusCode()) {
			ErrorResponse errorResponse = response.readEntity(ErrorResponse.class);
			throw new ClientErrorException(errorResponse.toString(), response);
		} else {
			throw new WebApplicationException("Unsupported status", response);
		}
	}
1226105
public static Response getStatusResponse(Response.Status status, String... messages) {
		if (status == null) {
			return Response.status(Response.Status.BAD_REQUEST).build();
		}
		String msg = StringUtils.join(messages, ". ");
		if (StringUtils.isBlank(msg)) {
			msg = status.getReasonPhrase();
		}
		try {
			return GenericExceptionMapper.getExceptionResponse(status.getStatusCode(), msg);
		} catch (Exception ex) {
			logger.error(null, ex);
			return Response.status(Response.Status.BAD_REQUEST).build();
		}
	}
760696
def error_response(message, status=400, code=None):
    """""""
    from django.http import JsonResponse
    data = {'message': message}
    if code:
        data['code'] = code
    LOG.error("Error response, status code is : {} | {}".format(status, data))
    return JsonResponse(data=data, status=status)
832059
def __is_json_error(self, status, headers):
    
    content_header = headers.get('content-type', '')
    content_type, unused_params = cgi.parse_header(content_header)
    return (status.startswith('400') and
            content_type.lower() in _ALL_JSON_CONTENT_TYPES)
966770
def check_error(self, response):
        
        if response.status_code == 500:
            raise ServiceError("500 - " + response.content)

        if response.status_code == 503:
            if "DDoS protection by Cloudflare" in response.content:
                raise ServiceError("Foiled by Cloudfare's DDoS protection")
            raise ServiceError("503 - Temporarily out of service.")

        if response.status_code == 429:
            raise ServiceError("429 - Too many requests")

        if response.status_code == 404:
            raise ServiceError("404 - Not Found")

        if response.status_code == 400:
            raise ServiceError("400 - Bad Request")
743433
protected function isResponseOk()
    {
        $status = $this->rawResponse->status;
        if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
            return true;
        }
        return false;
    }
397260
public static Tag status(ContainerResponse response) {
        /* In case there is no response we are dealing with an unmapped exception. */
        return (response != null)
                ? Tag.of("status", Integer.toString(response.getStatus()))
                : STATUS_SERVER_ERROR;
    }
671825
function PostmarkErrorStatus(response) {
  MessagingServiceStatus.call(this, 'postmark');

  // There was an error when attempting to send message
  this.state.message = response.code + ': ' + response.message;

  // Catch internal server error
  if (response.status == 500) {
    this.state.code = this.StatusCodes.SERVICE_DOWN;
    return
  }

  // See http://developer.postmarkapp.com/developer-api-overview.html for status error codes
  if (response.code == 400) this.state.code = this.StatusCodes.DATA_REJECTED;
  else if (response.code == 401) this.state.code = this.StatusCodes.DATA_REJECTED;
  else if (response.code == 405) this.state.code = this.StatusCodes.LIMIT_EXCEEDED;
  else if (response.code == 406) this.state.code = this.StatusCodes.DATA_REJECTED;
  else if (response.code == 507) this.state.code = this.StatusCodes.DATA_REJECTED;
  else if (response.code == 522) this.state.code = this.StatusCodes.DATA_REJECTED;
  else this.state.code = this.StatusCodes.DEFAULT;
}
1108111
protected function errorResponse(ServerRequestInterface $request, ResponseInterface $response)
    {
        if (
            interface_exists(GlobalEnvironmentInterface::class, false) &&
            $response instanceof GlobalEnvironmentInterface &&
            $response->isStale()
        ) {
            $response = $response->revive();
        }

        $errorResponse = $response->withProtocolVersion($request->getProtocolVersion())->withStatus(500);
        $errorResponse->getBody()->write('An unexpected error occured');

        return $errorResponse;
    }
1312223
function SendgridErrorStatus(response) {
  MessagingServiceStatus.call(this, 'sendgrid');

  // There was an error when attempting to send message
  this.state.message = response.message;

  // See https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html for errors
  // Currently unable to access the HTTP statusCode of the error response, so we must rely on the error messages
  if (this.state.message === 'Maximum credits exceeded') this.state.code = this.StatusCodes.LIMIT_EXCEEDED;
  else if (this.state.message === 'sendgrid error') this.state.code = this.StatusCodes.SERVICE_DOWN;
  else this.state.code = this.StatusCodes.DEFAULT;
}
674447
private static IQ respondError(AdHocCommandData response,
            StanzaError.Condition condition) {
        return respondError(response, StanzaError.getBuilder(condition));
    }
482883
public static void checkStatus(CloseableHttpResponse httpResponse, final int httpStatus)
      throws SDKException {

    if (httpResponse.getStatusLine().getStatusCode() != httpStatus) {
      log.error(
          "Status expected: "
              + httpStatus
              + " obtained: "
              + httpResponse.getStatusLine().getStatusCode());
      log.error("httpresponse: " + httpResponse.toString());
      String body;
      try {
        body = EntityUtils.toString(httpResponse.getEntity());
      } catch (IOException e) {
        e.printStackTrace();
        throw new SDKException(
            "Status is " + httpResponse.getStatusLine().getStatusCode(),
            new StackTraceElement[0],
            "could not provide reason because: " + e.getMessage());
      }
      log.error("Body: " + body);
      throw new SDKException(
          "Status is " + httpResponse.getStatusLine().getStatusCode(),
          new StackTraceElement[0],
          body);
    }
  }
141907
public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
        if (response.statusCode < 200 || response.statusCode >= 300) {
            throw new HTTPException(response.statusCode, response.reason);
        }
        return response;
    }