bs3m
Version:
TS/JS migrations framework for sqlite3 databases
30 lines • 1.01 kB
JavaScript
/** Error definitions and base error class. */
/**
* Base error class for all BS3M-specific errors.
*
* SQLite errors are not wrapped and will be re-thrown as-is.
*/
export class Bs3mError extends Error {
constructor(message) {
super(message);
this.name = 'Bs3mError';
}
}
/** Error thrown when migration string ID parsing fails. */
export 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';
}
}
/** Error thrown when migration module validation fails. */
export class MigrationModuleParseError extends Bs3mError {
constructor(migrationId, reason) {
super(`Invalid migration module "${migrationId}": ${reason}`);
this.name = 'MigrationModuleParseError';
}
}
//# sourceMappingURL=errors.js.map