Sha256: 7bd2996ead7dad20d091fcd30a6e0ee8d0e52032951af27107db54df8725d6ec

Contents?: true

Size: 1.52 KB

Versions: 9

Compression:

Stored size: 1.52 KB

Contents

# frozen_string_literal: true

module Grumlin
  class Error < StandardError; end

  class UnknownError < Error; end

  class ConnectionError < Error; end

  class CannotConnectError < ConnectionError; end

  class DisconnectError < ConnectionError; end

  class ConnectionStatusError < Error; end

  class NotConnectedError < ConnectionStatusError; end

  class AlreadyConnectedError < ConnectionStatusError; end

  class ProtocolError < Error; end

  class UnknownResponseStatus < ProtocolError
    attr_reader :status

    def initialize(status)
      super("unknown response status code #{status[:code]}")
      @status = status
    end
  end

  class UnknownTypeError < ProtocolError; end

  class StatusError < Error
    attr_reader :status

    def initialize(status)
      super(status[:message])
      @status = status
    end
  end

  class ClientSideError < StatusError; end

  class ServerSideError < StatusError; end

  class ScriptEvaluationError < ServerSideError; end

  class InvalidRequestArgumentsError < ServerSideError; end

  class ServerError < ServerSideError; end

  class ServerSerializationError < ServerSideError; end

  class ServerTimeoutError < ServerSideError; end

  class InternalClientError < Error; end

  class UnknownRequestStoppedError < InternalClientError; end

  class ResourceLeakError < InternalClientError; end

  class UnknownMapKey < InternalClientError
    attr_reader :key, :map

    def initialize(key, map)
      @key = key
      @map = map
      super("Cannot cast key #{key} in map #{map}")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
grumlin-0.7.0 lib/grumlin/exceptions.rb
grumlin-0.6.2 lib/grumlin/exceptions.rb
grumlin-0.6.1 lib/grumlin/exceptions.rb
grumlin-0.6.0 lib/grumlin/exceptions.rb
grumlin-0.5.1 lib/grumlin/exceptions.rb
grumlin-0.5.0 lib/grumlin/exceptions.rb
grumlin-0.4.0 lib/grumlin/exceptions.rb
grumlin-0.3.0 lib/grumlin/exceptions.rb
grumlin-0.2.0 lib/grumlin/exceptions.rb