Constructor
new AerospikeError()
Example
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
read : new Aerospike.ReadPolicy({socketTimeout : 0, totalTimeout : 0}),
write : new Aerospike.WritePolicy({socketTimeout : 0, totalTimeout : 0})
}
}
let key = new Aerospike.Key('test', 'key', 'does_not_exist')
Aerospike.connect()
.then(client => {
client.get(key)
.then(record => console.info(record))
.catch(error => console.error(`Error: ${error.message} [${error.code}]`))
.then(() => client.close())
})
Extends
- Error
Members
(nullable) client :Client
- Description:
The
Client
instance associated with this error, if any.
- Source:
- Since:
- v3.7.0
The Client
instance associated with this error, if any.
Type:
Example
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
read : new Aerospike.ReadPolicy({socketTimeout : 0, totalTimeout : 0}),
write : new Aerospike.WritePolicy({socketTimeout : 0, totalTimeout : 0})
}
}
Aerospike.connect(config).then(async client => {
await client.put(new Aerospike.Key('demo', 'test', 'foo'), { 'foo': 'bar' })
client.close()
}).catch(error => {
console.error('Error: %s [%i]', error.message, error.code)
if (error.client) error.client.close()
})
code :number
- Description:
Numeric status code returned by the server or the client.
- Source:
- See:
-
module:aerospike.status
contains the full list of possible status codes.
Numeric status code returned by the server or the client.
Type:
- number
(nullable) command :Object
Command during which the error occurred.
Type:
- Object
(nullable) file :string
- Description:
File name of the C/C++ source file in which the error occurred.
- Source:
File name of the C/C++ source file in which the error occurred.
Type:
- string
(nullable) func :string
C/C++ function name in which the error occurred.
Type:
- string
inDoubt :boolean
- Description:
It is possible that a write transaction completed even though the client returned this error. This may be the case when a client error occurs (like timeout) after the command was sent to the server.
- Source:
It is possible that a write transaction completed even though the client returned this error. This may be the case when a client error occurs (like timeout) after the command was sent to the server.
Type:
- boolean
(nullable) line :number
- Description:
Line number in the C/C++ source file in which the error occurred.
- Source:
Line number in the C/C++ source file in which the error occurred.
Type:
- number
Methods
isServerError() → {boolean}
- Description:
Indicates whether the error originated on the database server.
- Source:
Returns:
true
if the server raised the error,false
otherwise.
- Type
- boolean