Cassandra Error Code List

When using the datastax node.js driver, I get an exception code as described in http://docs.datastax.com/en/developer/nodejs-driver-dse/1.4/api/module.errors/class.ResponseError/ .

However, I cannot find documentation about all available exception codes. Does anyone know where to find it?

+4
source share
2 answers

I'm not sure that the code values ​​are listed anywhere, but you can always look at the source of ExceptionCode for the version from Cassandra that you are working with.

In trunk this errors are listed as:

SERVER_ERROR    (0x0000),
PROTOCOL_ERROR  (0x000A),

BAD_CREDENTIALS (0x0100),

// 1xx: problem during request execution
UNAVAILABLE         (0x1000),
OVERLOADED          (0x1001),
IS_BOOTSTRAPPING    (0x1002),
TRUNCATE_ERROR      (0x1003),
WRITE_TIMEOUT       (0x1100),
READ_TIMEOUT        (0x1200),
READ_FAILURE        (0x1300),
FUNCTION_FAILURE    (0x1400),
WRITE_FAILURE       (0x1500),
CDC_WRITE_FAILURE   (0x1600),

// 2xx: problem validating the request
SYNTAX_ERROR    (0x2000),
UNAUTHORIZED    (0x2100),
INVALID         (0x2200),
CONFIG_ERROR    (0x2300),
ALREADY_EXISTS  (0x2400),
UNPREPARED      (0x2500);
+4
source

, : https://datastax-oss.atlassian.net/browse/NODEJS-418

IDE (VS Code/WebStorm) / :

const responseErrorCodes = {
  serverError:            0x0000,
  protocolError:          0x000A,
  badCredentials:         0x0100,
  unavailableException:   0x1000,
  overloaded:             0x1001,
  isBootstrapping:        0x1002,
  truncateError:          0x1003,
  writeTimeout:           0x1100,
  readTimeout:            0x1200,
  readFailure:            0x1300,
  functionFailure:        0x1400,
  writeFailure:           0x1500,
  syntaxError:            0x2000,
  unauthorized:           0x2100,
  invalid:                0x2200,
  configError:            0x2300,
  alreadyExists:          0x2400,
  unprepared:             0x2500
};

- :

if (err.code === cassandra.types.responseErrorCodes.syntaxError) {
  // ...
}
+1

Source: https://habr.com/ru/post/1692313/


All Articles