Module: Fluent::Counter

Defined in:
lib/fluent/counter.rb,
lib/fluent/counter/error.rb,
lib/fluent/counter/store.rb,
lib/fluent/counter/client.rb,
lib/fluent/counter/server.rb,
lib/fluent/counter/validator.rb,
lib/fluent/counter/mutex_hash.rb,
lib/fluent/counter/base_socket.rb

Defined Under Namespace

Classes: ArrayValidator, BaseError, BaseSocket, CleanupThread, Client, Connection, Future, Handler, HashValidator, InternalServerError, InvalidParams, InvalidRequest, MethodNotFound, MutexHash, ParseError, Server, Store, UnknownKey, Validator

Class Method Summary collapse

Class Method Details

.raise_error(response) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fluent/counter/error.rb', line 65

def raise_error(response)
  msg = response['message']
  case response['code']
  when 'invalid_params'
    raise InvalidParams.new(msg)
  when 'unknown_key'
    raise UnknownKey.new(msg)
  when 'parse_error'
    raise ParseError.new(msg)
  when 'invalid_request'
    raise InvalidRequest.new(msg)
  when 'method_not_found'
    raise MethodNotFound.new(msg)
  when 'internal_server_error'
    raise InternalServerError.new(msg)
  else
    raise "Unknown code: #{response['code']}"
  end
end