Exception: UnifiedDB::ApiError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/unified_db/api_error.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



4
5
6
7
8
9
# File 'lib/unified_db/api_error.rb', line 4

def to_h
  {
    :result => 'error',
    :reason => message
  }
end

#to_json(*args) ⇒ Object



11
12
13
# File 'lib/unified_db/api_error.rb', line 11

def to_json(*args)
  UnifiedDB.json_encoder.encode to_h
end