Sha256: 89bdf87b7a05c62212fa7e73b13a247344e79748d5df0c3fed2c5fbadd6b9b94

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

module Gm
  module Notepad
    class RuntimeError < ::RuntimeError
    end
    class DuplicateKeyError < RuntimeError
      def initialize(key:, object:)
        super("Duplicate key for #{key.inspect} in #{object}")
      end
    end
    class MissingTableError < RuntimeError
      def initialize(name:)
        @name = name
        super(%((Missing table "#{name}")))
      end
      alias to_buffer_message to_s
    end
    class MissingTableEntryError < RuntimeError
      def initialize(table_name:, index:)
        super(%(Missing index "#{index}" for table "#{table_name}"))
      end
      alias to_buffer_message to_s
    end

    class ExceededTimeToLiveError < RuntimeError
      attr_reader :text_when_time_to_live_exceeded
      def initialize(text:, time_to_live:, text_when_time_to_live_exceeded:)
        @text_when_time_to_live_exceeded = text_when_time_to_live_exceeded
        super(%(Expanding the given text "#{text}" exceed the time to live of #{time_to_live}))
      end
      alias to_buffer_message to_s
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gm-notepad-0.0.18 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.17 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.16 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.15 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.14 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.13 lib/gm/notepad/exceptions.rb
gm-notepad-0.0.12 lib/gm/notepad/exceptions.rb