UNPKG

ottoman

Version:
57 lines 2.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IndexParamsUsingGSIExceptions = exports.IndexParamsOnExceptions = exports.QueryGroupByParamsException = exports.QueryOperatorNotFoundException = exports.MultipleQueryTypesException = exports.CollectionInWithinExceptions = exports.WhereClauseException = exports.SelectClauseException = void 0; const ottoman_errors_1 = require("../exceptions/ottoman-errors"); class SelectClauseException extends ottoman_errors_1.OttomanError { constructor() { // todo: update message super('The SELECT clause does not have the proper structure'); } } exports.SelectClauseException = SelectClauseException; class WhereClauseException extends ottoman_errors_1.OttomanError { constructor(message = '') { super(`The WHERE clause does not have the proper structure. ${message}`); } } exports.WhereClauseException = WhereClauseException; class CollectionInWithinExceptions extends WhereClauseException { constructor(message = 'The Collection Operator needs to have the following clauses declared (IN | WITHIN) and SATISFIES.') { super(); this.message = message; } } exports.CollectionInWithinExceptions = CollectionInWithinExceptions; class MultipleQueryTypesException extends ottoman_errors_1.OttomanError { constructor(type1, type2) { super(`Cannot combine multiple query types (ex: ${type1} with ${type2}`); } } exports.MultipleQueryTypesException = MultipleQueryTypesException; class QueryOperatorNotFoundException extends WhereClauseException { constructor(operator) { super(); this.message = `Operator not found: ${operator}`; } } exports.QueryOperatorNotFoundException = QueryOperatorNotFoundException; class QueryGroupByParamsException extends WhereClauseException { constructor() { super(); this.message = `The GROUP BY clause must be defined to use the LETTING and HAVING clauses`; } } exports.QueryGroupByParamsException = QueryGroupByParamsException; class IndexParamsOnExceptions extends ottoman_errors_1.OttomanError { constructor(clause) { super(`The ON parameter can only be applied in the following clauses: ${JSON.stringify(clause)}`); } } exports.IndexParamsOnExceptions = IndexParamsOnExceptions; class IndexParamsUsingGSIExceptions extends ottoman_errors_1.OttomanError { constructor(clause) { super(`The USING GSI parameter can only be applied in the following clauses: ${JSON.stringify(clause)}`); } } exports.IndexParamsUsingGSIExceptions = IndexParamsUsingGSIExceptions; //# sourceMappingURL=exceptions.js.map