bs3m
Version:
TS/JS migrations framework for sqlite3 databases
36 lines • 1.31 kB
JavaScript
;
/** Error definitions and base error class. */
Object.defineProperty(exports, "__esModule", { value: true });
exports.MigrationModuleParseError = exports.MigrationIdParseError = exports.Bs3mError = void 0;
/**
* Base error class for all BS3M-specific errors.
*
* SQLite errors are not wrapped and will be re-thrown as-is.
*/
class Bs3mError extends Error {
constructor(message) {
super(message);
this.name = 'Bs3mError';
}
}
exports.Bs3mError = Bs3mError;
/** Error thrown when migration string ID parsing fails. */
class MigrationIdParseError extends Bs3mError {
constructor(stringId, reason) {
const message = reason
? `Invalid migration string ID "${stringId}": ${reason}`
: `Invalid migration string ID "${stringId}"`;
super(message);
this.name = 'MigrationIdParseError';
}
}
exports.MigrationIdParseError = MigrationIdParseError;
/** Error thrown when migration module validation fails. */
class MigrationModuleParseError extends Bs3mError {
constructor(migrationId, reason) {
super(`Invalid migration module "${migrationId}": ${reason}`);
this.name = 'MigrationModuleParseError';
}
}
exports.MigrationModuleParseError = MigrationModuleParseError;
//# sourceMappingURL=errors.js.map