class WorkSnaps::Error

Constants

EnhanceYourCalm

Raised when WorkSnaps returns the HTTP status code 429

RateLimited

Raised when WorkSnaps returns the HTTP status code 429

Attributes

wrapped_exception[R]

Public Class Methods

descendants() click to toggle source
# File lib/worksnaps/error.rb, line 9
def self.descendants
  ObjectSpace.each_object(::Class).select{|klass| klass < self}
end
errors() click to toggle source
# File lib/worksnaps/error.rb, line 5
def self.errors
  @errors ||= Hash[descendants.map{|klass| [klass.const_get(:HTTP_STATUS_CODE), klass]}]
end
new(exception=$!, response_headers={}) click to toggle source
Calls superclass method
# File lib/worksnaps/error.rb, line 13
def initialize(exception=$!, response_headers={})
  @wrapped_exception = exception
  exception.respond_to?(:backtrace) ? super(exception.message) : super(exception.to_s)
end

Public Instance Methods

backtrace() click to toggle source
Calls superclass method
# File lib/worksnaps/error.rb, line 18
def backtrace
  @wrapped_exception.respond_to?(:backtrace) ? @wrapped_exception.backtrace : super
end