Sha256: e3c62ceae379daa0efefc0fa00a7de75b7e7a0246c3c3b809ea975c2326c0bac

Contents?: true

Size: 1.37 KB

Versions: 83

Compression:

Stored size: 1.37 KB

Contents

# encoding: utf-8

class HighLine
  # Internal HighLine errors.
  module CustomErrors
    # An error that responds to :explanation_key
    class ExplainableError < StandardError
      # Explanation key as Symbol or nil. Used to
      # select the proper error message to be displayed.
      # @return [nil, Symbol] explanation key to get the
      #   proper error message.
      def explanation_key
        nil
      end
    end

    # Bare Question error
    class QuestionError < ExplainableError
      # (see ExplainableError#explanation_key)
      def explanation_key
        nil
      end
    end

    # Invalid Question error
    class NotValidQuestionError < ExplainableError
      # (see ExplainableError#explanation_key)
      def explanation_key
        :not_valid
      end
    end

    # Out of Range Question error
    class NotInRangeQuestionError < ExplainableError
      # (see ExplainableError#explanation_key)
      def explanation_key
        :not_in_range
      end
    end

    # Unconfirmed Question error
    class NoConfirmationQuestionError < ExplainableError
      # (see ExplainableError#explanation_key)
      def explanation_key
        nil
      end
    end

    # Unavailable auto complete error
    class NoAutoCompleteMatch < ExplainableError
      # (see ExplainableError#explanation_key)
      def explanation_key
        :no_completion
      end
    end
  end
end

Version data entries

83 entries across 68 versions & 5 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/highline-3.1.1/lib/highline/custom_errors.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/highline-3.1.1/lib/highline/custom_errors.rb
highline-3.1.2 lib/highline/custom_errors.rb
brakeman-7.0.0 bundle/ruby/3.1.0/gems/highline-3.1.1/lib/highline/custom_errors.rb
brakeman-6.2.2 bundle/ruby/3.1.0/gems/highline-3.1.1/lib/highline/custom_errors.rb
brakeman-6.2.2.rc1 bundle/ruby/3.3.0/gems/highline-3.1.1/lib/highline/custom_errors.rb
highline-3.1.1 lib/highline/custom_errors.rb
brakeman-6.2.1 bundle/ruby/3.1.0/gems/highline-3.1.0/lib/highline/custom_errors.rb
brakeman-6.2.0 bundle/ruby/3.1.0/gems/highline-3.1.0/lib/highline/custom_errors.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/highline-3.0.1/lib/highline/custom_errors.rb
highline-3.1.0 lib/highline/custom_errors.rb
brakeman-6.1.2 bundle/ruby/3.3.0/gems/highline-3.0.1/lib/highline/custom_errors.rb
highline-3.0.1 lib/highline/custom_errors.rb
highline-3.0.0 lib/highline/custom_errors.rb
brakeman-6.1.1 bundle/ruby/3.0.0/gems/highline-2.1.0/lib/highline/custom_errors.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/highline-2.1.0/lib/highline/custom_errors.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/highline-2.1.0/lib/highline/custom_errors.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/highline-2.1.0/lib/highline/custom_errors.rb
highline-3.0.0.pre.1 lib/highline/custom_errors.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/highline-2.1.0/lib/highline/custom_errors.rb