module Rack class GenericProxyURI < Exception attr_reader :url def intialize(url) @url = url end def to_s %Q(Your URL "#{@url}" is too generic. Did you mean "http://#{@url}"?) end end class AmbiguousProxyMatch < Exception attr_reader :path, :matches def initialize(path, matches) @path = path @matches = matches end def to_s %Q(Path "#{path}" matched multiple endpoints: #{formatted_matches}) end private def formatted_matches matches.map {|matcher| matcher.to_s}.join(', ') end end end