Return the first error we get
328947
def as_json(options=nil)
      return {} if messages.empty?
      attribute, types = messages.first
      type             = types.first

      {
        :error => {
          :param => attribute,
          :type  => type,
          :message => nil
        }
      }
    end
43524
def getCameraErrorNameFromEnum(self, eCameraError):
        """"""

        fn = self.function_table.getCameraErrorNameFromEnum
        result = fn(eCameraError)
        return result
1370225
public function error(string $name = '', bool $first = false)
    {
        $errors = $this->errors();

        if (empty($name)) {
            // Return all errors messages by default if the
            // name argument is not specified.
            return $errors->all();
        }

        $field = $this->repository->getFieldByName($name);

        if ($first) {
            return $errors->first($field->getName());
        }

        return $errors->get($field->getName());
    }
294866
def getPropErrorNameFromEnum(self, error):
        

        fn = self.function_table.getPropErrorNameFromEnum
        result = fn(error)
        return result
564149
def get_errors(self):
        
        result = []
        while not self.errors.empty():  # pragma: no cover
            try:
                e = self.errors.get(False)
                result.append(e)
            except self.errors.Empty:
                continue
            self.errors.task_done()
        return result
606870
def get_error(self, block = True, timeout = None):
		
		return self._error_queue.get(block = block, timeout = timeout)
5400
def get_error(exc):
    

    if isinstance(exc, HTTPError):
        # Returning the HTTP Error code coming from requests module
        return exc.response.status_code, text(exc.response.content)

    if isinstance(exc, Timeout):
        # A timeout is a 408, and it's not a HTTPError (why? dunno).
        return 408, exc

    if isinstance(exc, Http404):
        # 404 is 404
        return 404, exc

    if isinstance(exc, PermissionDenied):
        # Permission denied is 403
        return 403, exc

    if isinstance(exc, SuspiciousOperation):
        # Shouldn't happen, but you never know
        return 400, exc

    # The default error code is 500
    return 500, exc
758405
def first(self):
        
        pairs = self.resolve()
        try:
            return iter_first(pairs)
        except ValueError:
            raise NotFoundError(u"{0} not found".format(self.name))
498421
function error(err) {
    if (!(err instanceof Error)) return err
    return {
        code: err.code,
        message: err.message,
        details: err.detail,
        stack: err.stack || ''
    }
}
291579
def get_last_error(self):
        
        error = ctypes.c_int32()
        result = self.library.Par_GetLastError(self.pointer, ctypes.byref(error))
        check_error(result, "partner")
        return error
831227
def _bad_result(cls, error):
        
        return cls.Result(ok=False, expr='', files={}, stdout='', type='', value=error)
1340590
def error(self, line_number, offset, text, check):
        """"""
        code = super(StandardReport, self).error(line_number, offset,
                                                 text, check)
        if code and (self.counters[code] == 1 or self._repeat):
            self._deferred_print.append(
                (line_number, offset, code, text[5:], check.__doc__))
        return code
1232405
function getOnError (msg) {
            return function getLastFoundDevicesErrorHandler (err) {
                console.error('An Error', err, msg, err.stack);
                var errDefered = q.defer();
                errDefered.reject(err);
                return errDefered.promise;
            };
        }
870441
def check_error(result, func, cargs):
    ""
    if result != 0:
        msg = 'Error in "%s": %s' % (func.__name__, get_errors(result) )
        raise RTreeError(msg)
    return
1167892
public function getFirstError()
    {
        if (!$this->model) {
            return false;
        }

        $errors = $this->model->getErrors()->errors();

        return (count($errors) > 0) ? $errors[0] : false;
    }
915995
def get_first(self):
		""""""
		try: # Nested try..except because of Python 2.4
			self.lock.acquire()
			try:
				return self.get(self.data_idx[0])
			except (IndexError, ValueError):
				return "NONE"
		finally:
			self.lock.release()
457695
def get_error_hint(ctx, opts, exc):
    """"""
    module = sys.modules[__name__]
    get_specific_error_hint = getattr(module, "get_%s_error_hint" % exc.status, None)
    if get_specific_error_hint:
        return get_specific_error_hint(ctx, opts, exc)
    return None