bigquery-client
Version:
A feature-rich Node.js client for Google BigQuery with support for CRUD operations, transactions, query building, and advanced features like aggregate functions, pagination, and logging.
42 lines (41 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeoutError = exports.ConnectionError = exports.ValidationError = exports.BigQueryError = exports.ErrorType = void 0;
var ErrorType;
(function (ErrorType) {
ErrorType["QUERY_ERROR"] = "QUERY_ERROR";
ErrorType["CONNECTION_ERROR"] = "CONNECTION_ERROR";
ErrorType["VALIDATION_ERROR"] = "VALIDATION_ERROR";
ErrorType["TIMEOUT_ERROR"] = "TIMEOUT_ERROR";
ErrorType["CACHE_ERROR"] = "CACHE_ERROR";
})(ErrorType || (exports.ErrorType = ErrorType = {}));
class BigQueryError extends Error {
constructor(message, code, details) {
super(message);
this.code = code;
this.details = details;
this.name = 'BigQueryError';
}
}
exports.BigQueryError = BigQueryError;
class ValidationError extends BigQueryError {
constructor(message, details) {
super(message, ErrorType.VALIDATION_ERROR, details);
this.name = 'ValidationError';
}
}
exports.ValidationError = ValidationError;
class ConnectionError extends BigQueryError {
constructor(message, details) {
super(message, ErrorType.CONNECTION_ERROR, details);
this.name = 'ConnectionError';
}
}
exports.ConnectionError = ConnectionError;
class TimeoutError extends BigQueryError {
constructor(message, details) {
super(message, ErrorType.TIMEOUT_ERROR, details);
this.name = 'TimeoutError';
}
}
exports.TimeoutError = TimeoutError;