StandardError
Custom error class for rescuing from all Twitter errors
@return [Array]
# File lib/twitter/error.rb, line 12 def self.descendants ObjectSpace.each_object(::Class).select{|klass| klass < self} end
@return [Hash]
# File lib/twitter/error.rb, line 7 def self.errors @errors ||= Hash[descendants.map{|klass| [klass.const_get(:HTTP_STATUS_CODE), klass]}] end
Initializes a new Error object
@param exception [Exception, String] @param response_headers [Hash] @return [Twitter::Error]
# File lib/twitter/error.rb, line 21 def initialize(exception=$!, response_headers={}) @rate_limit = Twitter::RateLimit.new(response_headers) if exception.respond_to?(:backtrace) super(exception.message) @wrapped_exception = exception else super(exception.to_s) end end
Generated with the Darkfish Rdoc Generator 2.