Exception: OMF::SFA::AM::Rest::RackException

Inherits:
Exception
  • Object
show all
Defined in:
lib/omf-sfa/am/am-rest/rest_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(err_code, reason) ⇒ RackException

Returns a new instance of RackException.



17
18
19
20
21
22
23
24
# File 'lib/omf-sfa/am/am-rest/rest_handler.rb', line 17

def initialize(err_code, reason)
  super reason
  body = {:exception => {
    :code => err_code,
    :reason => reason
  }}
  @reply = [err_code, {"Content-Type" => 'text/json'}, body.to_json]
end

Instance Attribute Details

#replyObject (readonly)

Returns the value of attribute reply.



15
16
17
# File 'lib/omf-sfa/am/am-rest/rest_handler.rb', line 15

def reply
  @reply
end