Sha256: a1844378795fe6865724985983b16ecccac29a784607341078e80a3bb0141cc4

Contents?: true

Size: 806 Bytes

Versions: 14

Compression:

Stored size: 806 Bytes

Contents

module Coach
  module Errors
    class MiddlewareDependencyNotMet < StandardError
      def initialize(middleware, previous_chain, missing_keys)
        @middleware = middleware
        @previous_chain = previous_chain
        @missing_keys = missing_keys

        super("\n\n#{chain_diagram}\n\n#{missing_keys_message}\n\n")
      end

      def missing_keys_message
        "  #{@middleware.name} is missing #{@missing_keys} from above!"
      end

      def chain_diagram
        @previous_chain.map do |middleware|
          "  #{middleware.name} => #{middleware.provided}"
        end.join("\n")
      end
    end

    class RouterUnknownDefaultAction < StandardError
      def initialize(action)
        super("Coach::Router does not know how to build action :#{action}")
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
coach-1.0.0 lib/coach/errors.rb
coach-0.5.2 lib/coach/errors.rb
coach-0.5.1 lib/coach/errors.rb
coach-0.5.0 lib/coach/errors.rb
coach-0.4.6 lib/coach/errors.rb
coach-0.4.5 lib/coach/errors.rb
coach-0.4.4 lib/coach/errors.rb
coach-0.4.3 lib/coach/errors.rb
coach-0.4.2 lib/coach/errors.rb
coach-0.4.1 lib/coach/errors.rb
coach-0.4.0 lib/coach/errors.rb
coach-0.3.0 lib/coach/errors.rb
coach-0.2.3 lib/coach/errors.rb
coach-0.2.2 lib/coach/errors.rb