Checks the response to see if there were any errors specific to
        this WSDL.
960322
def _check_response_for_request_errors(self):
        
        if self.response.HighestSeverity == "ERROR":
            for notification in self.response.Notifications:  # pragma: no cover
                if notification.Severity == "ERROR":
                    if "Postal Code Not Found" in notification.Message:
                        raise FedexPostalCodeNotFound(notification.Code,
                                                      notification.Message)

                    elif "Invalid Postal Code Format" in self.response.Notifications:
                        raise FedexInvalidPostalCodeFormat(notification.Code,
                                                           notification.Message)
                    else:
                        raise FedexError(notification.Code,
                                         notification.Message)
129253
def check_response(res):
    
    try:
        res.raise_for_status() # Alternative is res.ok
    except Exception as exc:
        # Bad response code, e.g. if adding an edge with nodes that doesn't exist
        try:
            err_info = res.json()
            err_msg = err_info['message'] # or 'localizeMessage'
        except ValueError:
            err_msg = res.text[:40] # Take the first 40 chars of the response
        except KeyError:
            err_msg = res.text[:40] + ("(No 'message' in err_info dict: %s"
                                       % list(err_info.keys()))
        exc.args += (err_msg,)
        raise exc
647551
def processResponse(cls, soapdata, **kw):
        
        if len(soapdata) == 0:
            raise TypeError('Received empty response')

#        log.msg("_" * 33, time.ctime(time.time()), 
#                  "RESPONSE: \n%s" %soapdata, debug=True)

        ps = ParsedSoap(soapdata, readerclass=cls.readerClass)
        if ps.IsAFault() is True:
            log.msg('Received SOAP:Fault', debug=True)
            raise FaultFromFaultMessage(ps)

        return ps
708803
def check_api_error(api_response):
    print(api_response)
    """"""
    if type(api_response) == dict and 'code' in api_response and api_response['code'] <> 200:
            print("Server response code: %s" % api_response['code'])
            print("Server response: %s" % api_response)
            raise exceptions.HTTPError('Unexpected response', response=api_response)
    if type(api_response) == dict and (api_response.get('status') == 'failed'):
        if 'ProgrammingError' in api_response.get('exception_cls'):
            raise DatabaseError(message='PyBossa database error.',
                                error=api_response)
        if ('DBIntegrityError' in api_response.get('exception_cls') and
            'project' in api_response.get('target')):
            msg = 'PyBossa project already exists.'
            raise ProjectAlreadyExists(message=msg, error=api_response)
        if 'project' in api_response.get('target'):
            raise ProjectNotFound(message='PyBossa Project not found',
                                  error=api_response)
        if 'task' in api_response.get('target'):
            raise TaskNotFound(message='PyBossa Task not found',
                               error=api_response)
        else:
            print("Server response: %s" % api_response)
            raise exceptions.HTTPError('Unexpected response', response=api_response)
734525
def check(self, action, version=None):
        
        if action not in self._by_action:
            raise APIError(400, "InvalidAction", "The action %s is not valid "
                           "for this web service." % action)
        by_version = self._by_action[action]
        if None not in by_version:
            # There's no catch-all method, let's try the version-specific one
            if version not in by_version:
                raise APIError(400, "InvalidVersion", "Invalid API version.")
624944
def has_error(self):
        
        return next(
            (True for cr in self.component_results
             if cr.has_error()),
            False
        )
66996
boolean isErrorResponse(HttpResponse response) {
        StatusLine status = response.getStatusLine();
        if (status == null || status.getStatusCode() != 200) {
            return true;
        }
        return false;
    }
337725
function isResponseError(response, callback) {
  if(response.error) {
    callback(new Error('Coinjar personal fair_rate api returned error: ' + response.error));
    return true;
  }
  if(!response.body) {
    callback(new Error('Coinjar personal fair_rate api returned error: No response body.'));
    return true;
  }
  return false;
}
1167120
private boolean isValid(String response, List<String> options) {

		boolean rslt = false;	// default...

		if (options.size() == 0) {
			// If no acceptable responses are specified, it's wide open...
			rslt = true;
		} else {
			for (String o : options) {
				if (response.matches(o)) {
					rslt = true;
					break;
				}
			}
		}
		
		return rslt;
		
	}
133700
def _check_error(response):
        """"""
        if 'error' in response:
            raise InfluxDBError(response['error'])
        elif 'results' in response:
            for statement in response['results']:
                if 'error' in statement:
                    msg = '{d[error]} (statement {d[statement_id]})'
                    raise InfluxDBError(msg.format(d=statement))
745530
def single_error_check(client, status)
      begin
        response_class = status[:response_class]
      rescue
        raise "no response_class found: #{status.inspect}" if !response_class
      end

      if status[:response_class] == "Error"
        return "#{status[:response_code]} - #{status[:message_text]}"
      elsif status[:response_class] == "Warning"
        Rews.log{|logger| logger.warn("#{status[:response_code]} - #{status[:message_text]}")}
      end
    end
448586
def _check_error_response(self, response, context):
        
        if "error" in response:
            satosa_logging(logger, logging.DEBUG, "%s error: %s %s" %
                           (type(response).__name__, response["error"], response.get("error_description", "")),
                           context.state)
            raise SATOSAAuthenticationError(context.state, "Access denied")
719560
function checkForError(resp) {
  if ('code' in resp) {
    throw errors.create(
      errors.types.BAD_REQUEST,
      errors.formatErrMsg(resp, ''),
      {body: resp}
    )
  }
  return resp
}
893532
def _check_response(response, items, default, indexed, stream, insensitive, fuzzy):
    ''''''
    # Set selection
    selection = None
    # if indexed, check for index
    if indexed:
        if response.isdigit():
            index_response = int(response)
            if index_response < len(items):
                selection = items[index_response]
    # if not matched by an index, match by text
    if selection is None:
        # insensivitize, if necessary
        original_items = items[:]
        original_response = response
        if insensitive:
            response = response.lower()
            items = [i.lower() for i in items]
        # Check for text matches
        if fuzzy:
            matches = _get_fuzzy_matches(response, items)
        # if insensitive, lowercase the comparison
        else:
            matches = [i for i in items if i.startswith(response)]
        # re-sensivitize if necessary
        if insensitive:
            matches = [
                i for i in original_items
                if i.lower() in matches
            ]
            response = original_response
        num_matches = len(matches)
        # Empty response, no default
        if response == '' and default is None:
            stream.write("[!] an empty response is not valid.\n")
        elif response == '':
            selection = default
        # Bad response
        elif num_matches == 0:
            stream.write("[!] \"{response}\" does not match any of the valid choices.\n".format(
                response=response
            ))
        # One match
        elif num_matches == 1:
            selection = matches[0]
        # Multiple matches
        else:
            # look for an exact match
            selection = _exact_match(response, matches, insensitive, fuzzy)
            # Multiple matches left
            if selection is None:
                stream.write("[!] \"{response}\" matches multiple choices:\n".format(
                    response=response
                ))
                for match in matches:
                    stream.write("[!]   {}\n".format(match))
                stream.write("[!] Please specify your choice further.\n")
    return selection
565325
private static boolean checkSuccess(HttpResponse response, boolean dryRun, TaskListener listener) {
        StatusLine status = response.getStatusLine();
        String content = "";
        try {
            content = ExtractorUtils.entityToString(response.getEntity());
            ExtractorUtils.validateStringNotBlank(content);
            JSONObject json = JSONObject.fromObject(content);
            String message = json.getString("message");
            if (assertResponseStatus(dryRun, listener, status, message)) {
                listener.getLogger().println(message);
                return true;
            }
        } catch (IOException e) {
            String parsingErrorStr = "Failed parsing distribution response";
            if (StringUtils.isNotBlank(content)) {
                parsingErrorStr = ": " + content;
            }
            e.printStackTrace(listener.error(parsingErrorStr));
        }
        return false;
    }
559503
public function hasErrors() {
    foreach ($this->jsonArray as $error) {
      if ($error['type'] != self::OK)
        return TRUE;
    }
    return FALSE;
  }
183806
public boolean checkResponseForException() {
    if (!finished && rsp != null) {
      Exception e;
      if ((e = rsp.getException()) != null) {
        setError(e.getMessage());
        setFinished();
        return true;
      }
    }
    return false;
  }