Exception: MHV::UserAccount::Errors::MHVClientError

Inherits:
UserAccountError
  • Object
show all
Defined in:
app/services/mhv/user_account/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from UserAccountError

#class_name

Constructor Details

#initialize(message, body = nil) ⇒ MHVClientError

Returns a new instance of MHVClientError.



25
26
27
28
# File 'app/services/mhv/user_account/errors.rb', line 25

def initialize(message, body = nil)
  super(message)
  @body = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



23
24
25
# File 'app/services/mhv/user_account/errors.rb', line 23

def body
  @body
end

Instance Method Details

#as_jsonObject



30
31
32
# File 'app/services/mhv/user_account/errors.rb', line 30

def as_json
  [{ title: message, detail: body[:message], code: body[:errorCode] }]
end