Sha256: fb6586304805b7a683fe965f98fe6e9eb52c4d0c8c2cea256e882f53808c5595

Contents?: true

Size: 736 Bytes

Versions: 18

Compression:

Stored size: 736 Bytes

Contents

require 'twitter/error'

module Twitter
  class Error
    # Raised when Twitter returns a 5xx HTTP status code
    class ServerError < Twitter::Error
      MESSAGE = "Server Error"

      # Create a new error from an HTTP environment
      #
      # @param response [Hash]
      # @return [Twitter::Error]
      def self.from_response(response={})
        new(nil, response[:response_headers])
      end

      # Initializes a new ServerError object
      #
      # @param message [String]
      # @param response_headers [Hash]
      # @return [Twitter::Error::ServerError]
      def initialize(message=nil, response_headers={})
        super((message || self.class.const_get(:MESSAGE)), response_headers)
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
twitter-4.8.1 lib/twitter/error/server_error.rb
twitter-4.8.0 lib/twitter/error/server_error.rb
twitter-4.7.0 lib/twitter/error/server_error.rb
twitter-4.6.2 lib/twitter/error/server_error.rb
twitter-4.6.1 lib/twitter/error/server_error.rb
twitter-4.6.0 lib/twitter/error/server_error.rb
twitter-4.5.0 lib/twitter/error/server_error.rb
twitter-4.4.4 lib/twitter/error/server_error.rb
twitter-4.4.3 lib/twitter/error/server_error.rb
twitter-4.4.2 lib/twitter/error/server_error.rb
twitter-4.4.1 lib/twitter/error/server_error.rb
twitter-4.4.0 lib/twitter/error/server_error.rb
twitter-4.3.0 lib/twitter/error/server_error.rb
twitter-4.2.0 lib/twitter/error/server_error.rb
twitter-4.1.2 lib/twitter/error/server_error.rb
twitter-4.1.1 lib/twitter/error/server_error.rb
twitter-4.1.0 lib/twitter/error/server_error.rb
twitter-4.0.0 lib/twitter/error/server_error.rb