Pull the errors out of the response if present
@param object the parsed response object
436016
private void extractErrors(JsonObject object) {
        JsonObject response;
        try {
            response = object.getAsJsonObject("response");
        } catch (ClassCastException ex) {
            return; // response is non-object
        }
        if (response == null) { return; }

        JsonArray e = response.getAsJsonArray("errors");
        if (e == null) { return; }

        // Set the errors
        errors = new ArrayList<String>(e.size());
        for (int i = 0; i < e.size(); i++) {
            errors.add(e.get(i).getAsString());
        }
    }
113497
function processError (error) {
    if (_cb.beforeReturnError) { _cb.beforeReturnError(error); }
    if (_cb.returnError) { _cb.returnError(error, response); }
    if (_cb.afterReturnError) { _cb.afterReturnError(error); }
  }
80128
private void invokeIgnoreExceptions(Object obj, String method,
            Object... args) {
        try {
            invoke(obj, method, args);
        } catch (NoSuchMethodException e) {
            logger.trace("Unable to log progress", e);
        } catch (InvocationTargetException e) {
            logger.trace("Unable to log progress", e);
        } catch (IllegalAccessException e) {
            logger.trace("Unable to log progress", e);
        }
    }
756851
protected void handleDeletedObject(final Object object) {
		runWithWriteLock(new Runnable() {
			public void run() {
				int index = getFinalEventList().indexOf(object);
				if (index >= 0) {
					getFinalEventList().remove(index);
				}
			}
		});
	}
110134
@SuppressWarnings("unchecked") 
   private static void error(Object o, Throwable t)
   {
      if (logging != null)
      {
         try
         {
            Class<?> clz = logging.getClass();
            Method mError = clz.getMethod("error", Object.class, Throwable.class);
            mError.invoke(logging, new Object[] {o, t});
         }
         catch (Throwable th)
         {
            // Nothing we can do
         }
      }
      else
      {
         if (o != null)
            System.out.println(o.toString());

         if (t != null)
            t.printStackTrace(System.out);
      }
   }
440603
function extractError(response, request) {

	var result,
	    entry,
	    req,
	    i;

	response = Blast.Bound.Array.cast(response);
	request = Blast.Bound.Array.cast(request);

	for (i = 0; i < response.length; i++) {
		entry = response[i];

		if (entry.error) {
			req = request[i] || {};
			result = new Error('Error in "' + req.type + '" command: ' + entry.error);
			result.type = req.type;
			result.vbmsg = entry.error;
			result.req = req;
			break;
		}
	}

	if (result) {
		result.original_response = response;
	}

	return result;
}
1065864
private static function handleErrors($response)
    {
        switch ($response->getStatusCode()) {
            case 200:
                return json_decode($response->getBody());
                break;
            case 401:
                throw new UnauthorizedException('Unauthorized (Invalid API key or insufficient permissions)');
                break;
            case 404:
                throw new NotFoundException('Object not found within your account scope');
                break;
            case 406:
                throw new InvalidFormatException('Requested format is not supported - request JSON or XML only');
                break;
            case 422:
                throw new ValidationException('Validation error(s) for create or update method');
                break;
            case 500:
                throw new ServerException('Something went wrong on Challonge\'s end');
                break;
            default:
                $decodedResponse = json_decode($response->getBody());
                throw new UnexpectedErrorException($decodedResponse);
                break;
        }
    }
1230926
public void collectChildError(String error)
    {
        if (_errorText == null) {
            _errorText = new InternalStringBuilder(32);
        }
        _errorText.append(error);
    }
1359581
def parse_error(self, response):
        ""
        error_code = response.split(' ')[0]
        if error_code in self.EXCEPTION_CLASSES:
            response = response[len(error_code) + 1:]
            return self.EXCEPTION_CLASSES[error_code](response)
        return ResponseError(response)
1229223
protected function checkResultErrors(Mollie_Response $object)
	{
		if (!$object->isSuccess()) {
			throw new Mollie_Exception(strval($object->resultmessage), intval($object->resultcode));
		}
	}
394
@SuppressWarnings("unchecked")
    public void postValidate(Object object) throws DataValidationException {
        if (_values != null || _ranges != null) {
            if (_values != null) for (Object value: _values) {
                if (value.equals(object)) return;
            }

            if (_ranges != null) for (@SuppressWarnings("rawtypes") Range r: _ranges) {
                @SuppressWarnings("rawtypes")
                Comparable o = (Comparable)object;
                if (r.inclusive) {
                    if ((r.min == null || r.min.compareTo(o) <= 0) && (r.max == null || o.compareTo(r.max) <= 0)) {
                        return;
                    }
                } else {
                    if ((r.min == null || r.min.compareTo(o) < 0) && (r.max == null || o.compareTo(r.max) < 0)) {
                        return;
                    }
                }
            }

            throw new DataValidationException("VALUES/RANGES", _name, object);
        }
    }
484596
protected String findError(T object)
    {
        String errorMessage=null;
        if(this.errorDetectionPath!=null)
        {
            String value=this.findValue(object,this.errorDetectionPath);
            if(value!=null)
            {
                boolean errorFound=false;
                if(this.errorDetectionValue==null)
                {
                    errorFound=true;
                }
                else if(this.errorDetectionValue.indexOf(value)!=-1)    //look for value in configured value
                {
                    errorFound=true;
                }
                
                if(errorFound)
                {
                    errorMessage=value;
                    if(this.errorMessagePath!=null)
                    {
                        value=this.findValue(object,this.errorMessagePath);
                        if(value!=null)
                        {
                            errorMessage=value;
                        }
                    }
                }
            }
        }
        
        return errorMessage;
    }
801442
private void validate(Object object) {
		Set<ConstraintViolation<Object>> viols = validator.validate(object);
		for (ConstraintViolation<Object> constraintViolation : viols) {
			if (Null.class.isAssignableFrom(constraintViolation.getConstraintDescriptor().getAnnotation().getClass())) {
				Object o = constraintViolation.getLeafBean();
				Iterator<Node> iterator = constraintViolation.getPropertyPath().iterator();
				String propertyName = null;
				while (iterator.hasNext()) {
					propertyName = iterator.next().getName();
				}
				if (propertyName != null) {
					try {
						PropertyDescriptor descriptor = BeanUtils.getPropertyDescriptor(o.getClass(), propertyName);
						descriptor.getWriteMethod().invoke(o, new Object[] { null });
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}
		}
	}
216159
function(error) {
  if (error instanceof Error) return error;

  var msg = error.err || error.errmsg || error.errMessage || error;
  var e = MongoError.create({ message: msg, driver: true });

  // Get all object keys
  var keys = typeof error === 'object' ? Object.keys(error) : [];

  for (var i = 0; i < keys.length; i++) {
    try {
      e[keys[i]] = error[keys[i]];
    } catch (err) {
      // continue
    }
  }

  return e;
}
429697
@Override
    public void fatal(Object object) {
        if (toSTDOUT) {
            printToStderr("FATAL", object.toString());
        } else {
            log4jLogger.fatal("" + object.toString());
        }
    }
548280
public void generateError(String response) {
        final String errorInString = extractParameter(response, ERROR_REGEX_PATTERN, true);
        final String errorDescription = extractParameter(response, ERROR_DESCRIPTION_REGEX_PATTERN, false);
        final String errorUriInString = extractParameter(response, ERROR_URI_REGEX_PATTERN, false);
        URI errorUri;
        try {
            errorUri = errorUriInString == null ? null : URI.create(errorUriInString);
        } catch (IllegalArgumentException iae) {
            errorUri = null;
        }

        OAuth2Error errorCode;
        try {
            errorCode = OAuth2Error.parseFrom(errorInString);
        } catch (IllegalArgumentException iaE) {
            //non oauth standard error code
            errorCode = null;
        }

        throw new OAuth2AccessTokenErrorResponse(errorCode, errorDescription, errorUri, response);
    }
1295227
function(request, response, next){
		if (utils.Misc.isEmptyObject(request.query)) {
			var errApp = new Error(errors['130']);
			response.end(utils.Misc.createResponse(null, errApp, 130));
		}
		else {
			next();
		}
	}