module RubyEventStore
  WrongExpectedEventVersion = Class.new(StandardError)
  InvalidExpectedVersion    = Class.new(StandardError)
  IncorrectStreamData       = Class.new(StandardError)
  SubscriberNotExist        = Class.new(StandardError)
  InvalidPageStart          = Class.new(ArgumentError)
  InvalidPageStop           = Class.new(ArgumentError)
  InvalidPageSize           = Class.new(ArgumentError)
  EventDuplicatedInStream   = Class.new(StandardError)
  ReservedInternalName      = Class.new(StandardError)
  InvalidHandler            = Class.new(StandardError)
  ProtobufEncodingFailed    = Class.new(StandardError)

  class EventNotFound < StandardError
    attr_reader :event_id

    def initialize(event_id)
      super("Event not found: #{event_id}")
      @event_id = event_id
    end
  end
end

module RubyEventStore
  Error                     = Class.new(StandardError)
  WrongExpectedEventVersion = Class.new(Error)
  InvalidExpectedVersion    = Class.new(Error)
  IncorrectStreamData       = Class.new(Error)
  SubscriberNotExist        = Class.new(Error)
  InvalidPageStart          = Class.new(Error)
  InvalidPageStop           = Class.new(Error)
  InvalidPageSize           = Class.new(Error)
  EventDuplicatedInStream   = Class.new(Error)
  ReservedInternalName      = Class.new(Error)
  InvalidHandler            = Class.new(Error)
  ProtobufEncodingFailed    = Class.new(Error)

  class EventNotFound < Error
    attr_reader :event_id

    def initialize(event_id)
      super("Event not found: #{event_id}")
      @event_id = event_id
    end
  end
end

Gather all RubyEventStore under Error class
Gather all RubyEventStore under Error class

It might be convenient to be able to catch all RES errors by rescuing
only RubyEventStore::Error instead of getting acknowledged with all
present and future errors.

[#620]
