Exception: ServiceNow::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/servicenow/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ApiError

Returns a new instance of ApiError.



5
6
7
8
9
10
11
12
# File 'lib/servicenow/exceptions.rb', line 5

def initialize(response)
  @response = response
  if response&.body
    @message = response.body.dig("error", "message")
    @detail = response.body.dig("error", "detail")
    @status = response.body["status"]
  end
end

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail.



3
4
5
# File 'lib/servicenow/exceptions.rb', line 3

def detail
  @detail
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/servicenow/exceptions.rb', line 3

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/servicenow/exceptions.rb', line 3

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/servicenow/exceptions.rb', line 3

def status
  @status
end