Exception: KeeperException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/zookeeper/keeper_exception.rb

Overview

these errors are returned rather than the driver level errors

Direct Known Subclasses

ApiError, AuthFailed, BadArguments, BadVersion, ConnectionLoss, DataInconsistency, InvalidACL, InvalidCallback, MarshallingError, NoAuth, NoChildrenForEphemerals, NoNode, NodeExists, NotEmpty, OperationTimeOut, RunTimeInconsistency, SessionExpired, SystemError, Unimplemented

Defined Under Namespace

Classes: ApiError, AuthFailed, BadArguments, BadVersion, ConnectionLoss, DataInconsistency, InvalidACL, InvalidCallback, MarshallingError, NoAuth, NoChildrenForEphemerals, NoNode, NodeExists, NotEmpty, OperationTimeOut, RunTimeInconsistency, SessionExpired, SystemError, Unimplemented

Constant Summary

OK =
0
SYSTEMERROR =

System and server-side errors

1
RUNTIMEINCONSISTENCY =
SYSTEMERROR - 1
DATAINCONSISTENCY =
SYSTEMERROR - 2
CONNECTIONLOSS =
SYSTEMERROR - 3
MARSHALLINGERROR =
SYSTEMERROR - 4
UNIMPLEMENTED =
SYSTEMERROR - 5
OPERATIONTIMEOUT =
SYSTEMERROR - 6
BADARGUMENTS =
SYSTEMERROR - 7
APIERROR =

API errors

100
NONODE =
APIERROR - 1
NOAUTH =
APIERROR - 2
BADVERSION =

Node does not exist Current operation not permitted Version conflict

APIERROR - 3
NOCHILDRENFOREPHEMERALS =
APIERROR - 8
NODEEXISTS =
APIERROR - 10
NOTEMPTY =
APIERROR - 11
SESSIONEXPIRED =
APIERROR - 12
INVALIDCALLBACK =
APIERROR - 13
INVALIDACL =
APIERROR - 14
AUTHFAILED =

client authentication failed

APIERROR - 15
ERROR_MAP =
{
  SYSTEMERROR             => SystemError,
  RUNTIMEINCONSISTENCY    => RunTimeInconsistency,
  DATAINCONSISTENCY       => DataInconsistency,
  CONNECTIONLOSS          => ConnectionLoss,
  MARSHALLINGERROR        => MarshallingError,
  UNIMPLEMENTED           => Unimplemented,
  OPERATIONTIMEOUT        => OperationTimeOut,
  BADARGUMENTS            => BadArguments,
  APIERROR                => ApiError,
  NONODE                  => NoNode,
  NOAUTH                  => NoAuth,
  BADVERSION              => BadVersion,
  NOCHILDRENFOREPHEMERALS => NoChildrenForEphemerals,
  NODEEXISTS              => NodeExists,
  NOTEMPTY                => NotEmpty,
  SESSIONEXPIRED          => SessionExpired,
  INVALIDCALLBACK         => InvalidCallback,
  INVALIDACL              => InvalidACL,
  AUTHFAILED              => AuthFailed,
}

Class Method Summary (collapse)

Class Method Details

+ (Object) by_code(code)



73
74
75
# File 'lib/zookeeper/keeper_exception.rb', line 73

def self.by_code(code)
  ERROR_MAP.fetch(code.to_i) { raise "API ERROR: no exception defined for code: #{code}" }
end

+ (Boolean) recognized_code?(code)

Returns:

  • (Boolean)


69
70
71
# File 'lib/zookeeper/keeper_exception.rb', line 69

def self.recognized_code?(code)
  ERROR_MAP.include?(code)
end