Skip to content

Latest commit

 

History

History
391 lines (249 loc) · 10.9 KB

exception.rst

File metadata and controls

391 lines (249 loc) · 10.9 KB

aerospike.exception --- Aerospike Exceptions

aerospike.exception

from __future__ import print_function

import aerospike
from aerospike.exception import *

try:
    config = { 'hosts': [ ('127.0.0.1', 3000)], 'policies': { 'total_timeout': 1200}}
    client = aerospike.client(config).connect()
    client.close()
except ClientError as e:
    print("Error: {0} [{1}]".format(e.msg, e.code))

1.0.44

In Doubt Status

The in doubt status of a caught exception can be checked by looking at the 5th element of its args tuple

key = 'test', 'demo', 1
record = {'some': 'thing'}
try:
  client.put(key, record)
except AerospikeError as exc:
  print("The in doubt nature of the operation is: {}".format(exc.args[4])

3.0.1

Exception Types

Exception Hierarchy

AerospikeError () +-- TimeoutError (9) +-- ClientError (-1) | +-- InvalidHost (-4) | +-- ParamError (-2) +-- ServerError (1) +-- InvalidRequest (4) +-- ServerFull (8) +-- AlwaysForbidden (10) +-- UnsupportedFeature (16) +-- DeviceOverload (18) +-- NamespaceNotFound (20) +-- ForbiddenError (22) +-- RecordError ()
   +-- RecordKeyMismatch (19)
   +-- RecordNotFound (2)
   +-- RecordGenerationError (3)
   +-- RecordExistsError (5)
   +-- RecordTooBig (13)
   +-- RecordBusy (14)
   +-- BinNameError (21)
   +-- BinExistsError (6)
   +-- BinNotFound (17)
   +-- BinIncompatibleType (12)

+-- IndexError (204) | +-- IndexNotFound (201) | +-- IndexFoundError (200) | +-- IndexOOM (202) | +-- IndexNotReadable (203) | +-- IndexNameMaxLen (205) | +-- IndexNameMaxCount (206) +-- QueryError (213) | +-- QueryQueueFull (211) | +-- QueryTimeout (212) +-- ClusterError (11) | +-- ClusterChangeError (7) +-- AdminError () | +-- SecurityNotSupported (51) | +-- SecurityNotEnabled (52) | +-- SecuritySchemeNotSupported (53) | +-- InvalidCommand (54) | +-- InvalidField (55) | +-- IllegalState (56) | +-- InvalidUser (60) | +-- UserExistsError (61) | +-- InvalidPassword (62) | +-- ExpiredPassword (63) | +-- ForbiddenPassword (64) | +-- InvalidCredential (65) | +-- InvalidRole (70) | +-- RoleExistsError (71) | +-- RoleViolation (81) | +-- InvalidPrivilege (72) | +-- NotAuthenticated (80) +-- UDFError () +-- UDFNotFound (1301) +-- LuaFileNotFound (1302)