Sha256: 998648d96e67a5f47475b468bac338c80cdfba96c391db6ac416479879078f12

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

module RackReverseProxy
  module Errors
    # GenericURI indicates that url is too generic
    class GenericURI < Exception
      attr_reader :url

      def intialize(url)
        @url = url
      end

      def to_s
        %(Your URL "#{@url}" is too generic. Did you mean "http://#{@url}"?)
      end
    end

    # AmbiguousMatch indicates that path matched more than one endpoint
    class AmbiguousMatch < Exception
      attr_reader :path, :matches

      def initialize(path, matches)
        @path = path
        @matches = matches
      end

      def to_s
        %(Path "#{path}" matched multiple endpoints: #{formatted_matches})
      end

      private

      def formatted_matches
        matches.map(&:to_s).join(", ")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-reverse-proxy-0.11.0 lib/rack_reverse_proxy/errors.rb
rack-reverse-proxy-0.10.0 lib/rack_reverse_proxy/errors.rb