Exception: ApiRequestFailure

Inherits:
ApiError show all
Defined in:
lib/tracer_client/errors/api_request_failure.rb

Direct Known Subclasses

ApiRequestFailureLog

Instance Attribute Summary

Attributes inherited from ApplicationError

#data, #tags

Instance Method Summary collapse

Methods inherited from ApplicationError

#with_alert?, #with_log?

Constructor Details

#initialize(subject, tags, response, data = {}) ⇒ ApiRequestFailure

Returns a new instance of ApiRequestFailure.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/tracer_client/errors/api_request_failure.rb', line 5

def initialize(subject, tags, response, data = {})
  super(subject, tags, data.merge({
                                      api_response: {
                                          status: response.code + ' ' + response.message,
                                          type:   response.content_type,
                                          length: response.content_length,
                                          body:   response.body.force_encoding('UTF-8'),

                                      },
                                  }))
end