Exception: AuthorizationHeaderParser::ParseError

Inherits:
InvalidHeader
  • Object
show all
Defined in:
lib/authorization_header_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, scanner) ⇒ ParseError

Returns a new instance of ParseError.



10
11
12
13
14
15
16
# File 'lib/authorization_header_parser.rb', line 10

def initialize(message, scanner)
  str = scanner.string
  from = [(scanner.pos - 5), 0].sort.pop
  upto = [(scanner.pos + 5), str.length].sort.shift
  piece = str[from..upto]
  super "#{message} - at #{scanner.pos} (around #{piece.inspect})"
end