Exception: EventStoreClient::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/event_store_client/errors.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonHash

Returns:

  • (Hash)


6
7
8
# File 'lib/event_store_client/errors.rb', line 6

def as_json(*)
  to_h.transform_keys(&:to_s)
end

#to_hHash

Returns:

  • (Hash)


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/event_store_client/errors.rb', line 11

def to_h
  hash =
    instance_variables.each_with_object({}) do |var, result|
      key = var.to_s
      key[0] = '' # remove @ sign
      result[key.to_sym] = instance_variable_get(var)
    end
  hash[:message] = message
  hash[:backtrace] = backtrace
  hash
end