File: unauthorized_error.rb

package info (click to toggle)
ruby-mechanize 2.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,312 kB
  • ctags: 1,480
  • sloc: ruby: 11,170; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Mechanize::UnauthorizedError < Mechanize::ResponseCodeError

  attr_reader :challenges

  def initialize page, challenges, message
    super page, message
    @challenges = challenges
  end

  def to_s
    out = super

    if @challenges then
      realms = @challenges.map(&:realm_name).join ', '
      out << " -- available realms: #{realms}"
    end

    out
  end

end