Method: Gruf::Error#to_h

Defined in:
lib/gruf/error.rb

#to_hHash

Return the error represented in Hash form

Returns:

  • (Hash)

    The error as a hash



153
154
155
156
157
158
159
160
161
# File 'lib/gruf/error.rb', line 153

def to_h
  {
    code: code,
    app_code: app_code,
    message: message,
    field_errors: field_errors.map(&:to_h),
    debug_info: debug_info.to_h
  }
end