For unify the action being dispatched, you might NOT need it! `result` might be the payload or the error, depending how the request end up
180406
function resolveHandler(_ref4) {
  var action = _ref4.action;
  var type = _ref4.type;
  var payload = _ref4.payload;
  var error = _ref4.error;
  return _extends({}, action, { type: type, payload: payload, error: error });
}
471471
def _result_handler(self, response: Dict[str, Any]):
        
        res = response.get("MESSAGE")
        ID = res.get("ID")
        result = res.get("RESULT")
        fut = self.tasks.get(ID)
        fut.set_result(result)
        return True
1103114
def request(operation, version = nil, params = {})
      response = open(request_url(operation, version, params), @http_opts) do |f|
        @raw_response = f.read
        JSON.parse(@raw_response)
      end
      unless response['Header']['Status'] == 'Success'
        raise ApiError.new(response['Header']['Status'], response['Header']['StatusMsg']) 
      end
      extract_result(response, operation)
    end
334508
def return! request = nil, result = nil, & block
      if (200..207).include? code
        self
      elsif [301, 302, 307].include? code
        unless [:get, :head].include? args[:method]
          raise Exceptions::EXCEPTIONS_MAP[code].new(self, code)
        else
          follow_redirection(request, result, & block)
        end
      elsif code == 303
        args[:method] = :get
        args.delete :payload
        follow_redirection(request, result, & block)
      elsif Exceptions::EXCEPTIONS_MAP[code]
        raise Exceptions::EXCEPTIONS_MAP[code].new(self, code)
      else
        raise RequestFailed.new(self, code)
      end
    end
981882
function(){
            if(errors.length) return cb(errors);
            var transform = opts.transform || function(_result, _cb){
              _cb(null, _result);
            };
            transform(result, function(err, _result){
              if(err){
                errors.push(formatError(err, key));
                cb(errors);
              }else{
                cb(null, _result);
              }
            });
          }
203423
def result_to_event(result)
      { :type => "Result",
        :from => result.from,
        :data => {
          :result => result.results,
          :duration => result.duration,
          :request_uuid => result.token,
          :request_from => result.request_from } }
    end
963211
def _result_handler(self, response: Dict[str, Any]):
        
        res = response.get("MESSAGE")
        result = res.get("RESULT")
        return result
1127091
def succeed(self, instance, action):
        
        uid = api.get_uid(instance)
        return self.objects.get(uid, {}).get(action, {}).get('success', False)
673808
def result(body, type)
      result = JSON.load(body)

      case type
      when 'api/send'
        body
      when 'api/status'
        body
      when 'api/cancel'
        body
      end

    end
4741
function catchResults (resolve, reject, err, client, done) {
	//debug.log('catchResults()...');
	if (err) {
		return reject(err);
	}
	resolve({"client":client, "done":done});
}
1108950
def InitFromFlowResult(self, flow_result):
    """"""

    self.payload_type = compatibility.GetName(flow_result.payload.__class__)
    self.payload = flow_result.payload
    self.client_id = flow_result.client_id
    self.timestamp = flow_result.timestamp

    return self
392851
private boolean havePropogatedError() {
		Request req = getRequest();
		return req != null && req.getAttribute(ACTION_ERROR_KEY) != null;
	}
756668
def _fail_if_contains_errors(response, sync_uuid=None):
    
    if response.status_code != _HTTP_OK:
        raise RequestError(response)
    response_json = response.json()
    if sync_uuid and 'sync_status' in response_json:
        status = response_json['sync_status']
        if sync_uuid in status and 'error' in status[sync_uuid]:
            raise RequestError(response)
227257
def call(action, query={}, &blk)
      call!(action, expand(query)) do |code, data|
        case code
        when 200
          response = compact(data)
        when 400...500
          messages = if data["Response"]
            Array(data["Response"]["Errors"]).map {|_, e| e["Message"] }
          elsif data["ErrorResponse"]
            Array(data["ErrorResponse"]["Error"]["Code"])
          end
          raise InvalidRequest, messages.join(",")
        else
          msg = "unexpected response #{code} -> #{data.inspect}"
          raise InvalidRequest, msg
        end

        if blk
          blk.call(response)
        else
          response
        end
      end
    end
159574
function onSaveSuccess(model, params, result) {
  Flux.dispatch(actionTypes.API_SAVE_SUCCESS, {
    model: model,
    params: params,
    result: result,
  })
  return result
}
887799
def request_fetch(self, user, repo, request, pull=False, force=False): #pragma: no cover
        '''
        '''
        raise NotImplementedError
585110
@Override
	public void error(AuthzTrans trans, HttpServletResponse response, Result<?> result) {
		String msg = result.details==null?"":result.details.trim();
		String[] detail;
		if(result.variables==null) {
			detail = new String[1];
		} else {
			int l = result.variables.length;
			detail=new String[l+1];
			System.arraycopy(result.variables, 0, detail, 1, l);
		}
		error(trans, response, result.status,msg,detail);
	}