Exception: Usps::Imis::Error::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/usps/imis/error/api_error.rb

Overview

Base error class for all internal exceptions

Direct Known Subclasses

MapperError, ResponseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, metadata = {}) ⇒ ApiError

A new instance of ApiError

Parameters:

  • message (String)

    The base exception message

  • metadata (Hash) (defaults to: {})

    Additional call-specific metadata to pass through to Bugsnag



18
19
20
21
# File 'lib/usps/imis/error/api_error.rb', line 18

def initialize(message,  = {})
  super(message)
  @metadata = 
end

Instance Attribute Details

#metadataObject

Additional call-specific metadata to pass through to Bugsnag



11
12
13
# File 'lib/usps/imis/error/api_error.rb', line 11

def 
  @metadata
end

Instance Method Details

#bugsnag_meta_dataHash

Additional metadata to include in Bugsnag reports

Can include fields at the top level, which will be shows on the custom tab

Can include fields nested under a top-level key, which will be shown on a tab with the top-level key as its name

Returns:



32
33
34
# File 'lib/usps/imis/error/api_error.rb', line 32

def 
   == {} ? {} : 
end