@valkey/valkey-glide
Version:
General Language Independent Driver for the Enterprise (GLIDE) for Valkey
44 lines (43 loc) • 1.69 kB
JavaScript
;
/**
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurationError = exports.ConnectionError = exports.ExecAbortError = exports.TIMEOUT_ERROR = exports.TimeoutError = exports.RequestError = exports.ClosingError = exports.ValkeyError = void 0;
/// Base class for errors.
class ValkeyError extends Error {
message;
constructor(message) {
super();
this.message = message ?? "No error message provided";
}
get name() {
return this.constructor.name;
}
}
exports.ValkeyError = ValkeyError;
/// Errors that report that the client has closed and is no longer usable.
class ClosingError extends ValkeyError {
}
exports.ClosingError = ClosingError;
/// Errors that were reported during a request.
class RequestError extends ValkeyError {
}
exports.RequestError = RequestError;
/// Errors that are thrown when a request times out.
class TimeoutError extends RequestError {
}
exports.TimeoutError = TimeoutError;
exports.TIMEOUT_ERROR = new TimeoutError("Operation timed out");
/// Errors that are thrown when a transaction is aborted.
class ExecAbortError extends RequestError {
}
exports.ExecAbortError = ExecAbortError;
/// Errors that are thrown when a connection disconnects. These errors can be temporary, as the client will attempt to reconnect.
class ConnectionError extends RequestError {
}
exports.ConnectionError = ConnectionError;
/// Errors that are thrown when a request cannot be completed in current configuration settings.
class ConfigurationError extends RequestError {
}
exports.ConfigurationError = ConfigurationError;