Sha256: 4dcd6ab1a450021e827a5e902023a2c55045043f721898ea9d54a82719169f0e

Contents?: true

Size: 792 Bytes

Versions: 11

Compression:

Stored size: 792 Bytes

Contents

module WebFinger
  class Exception < StandardError; end

  class HttpError < Exception
    attr_accessor :status, :response
    def initialize(status, message = nil, response = nil)
      super message
      @status = status
      @response = response
    end
  end

  class BadRequest < HttpError
    def initialize(message = nil, response = nil)
      super 400, message, response
    end
  end

  class Unauthorized < HttpError
    def initialize(message = nil, response = nil)
      super 401, message, response
    end
  end

  class Forbidden < HttpError
    def initialize(message = nil, response = nil)
      super 403, message, response
    end
  end

  class NotFound < HttpError
    def initialize(message = nil, response = nil)
      super 404, message, response
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
webfinger-1.2.0 lib/webfinger/exception.rb
webfinger-1.1.0 lib/webfinger/exception.rb
webfinger-1.0.2 lib/webfinger/exception.rb
webfinger-1.0.1 lib/webfinger/exception.rb
webfinger-1.0.0 lib/webfinger/exception.rb
webfinger-0.0.5 lib/webfinger/exception.rb
webfinger-0.0.4 lib/webfinger/exception.rb
webfinger-0.0.3 lib/webfinger/exception.rb
webfinger-0.0.2 lib/webfinger/exception.rb
webfinger-0.0.1 lib/webfinger/exception.rb
webfinger-0.0.0 lib/webfinger/exception.rb