class Postmen::RequestError

Generic exception raised if the API returns an error

Attributes

request[R]

Public Class Methods

new(request) click to toggle source
# File lib/postmen/errors.rb, line 11
def initialize(request)
  @request = request
end

Public Instance Methods

code() click to toggle source

Internal API error code @see docs.postmen.com/errors.html List of Error codes

# File lib/postmen/errors.rb, line 29
def code
  meta[:code]
end
details() click to toggle source

Returns details for the request error @see docs.postmen.com/#meta API Documentation

# File lib/postmen/errors.rb, line 23
def details
  meta[:details]
end
message() click to toggle source

Returns human-readable error message @see docs.postmen.com/#meta API Documentation

# File lib/postmen/errors.rb, line 35
def message
  meta[:message]
end
retryable?() click to toggle source

Indicates whether request is retryable. @see docs.postmen.com/errors.html API Documentation

# File lib/postmen/errors.rb, line 17
def retryable?
  meta.fetch(:retryable, false)
end