nestjs-transaction
Version:
A library that extracts and provides only some of the functions of the 'typeorm-transactional' npm module that are needed to operate in the Nestjs + TypeORM environment
39 lines • 1.56 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotRollBackError = exports.TypeOrmUpdatedPatchError = exports.NoRegistedDataSourceError = exports.TransactionalError = void 0;
class TransactionalError extends Error {
constructor() {
super(...arguments);
this.name = 'TransactionalError';
}
}
exports.TransactionalError = TransactionalError;
class NoRegistedDataSourceError extends TransactionalError {
constructor() {
super('There is no registered DataSource. DataSource must be registered through addTransactionalDataSource.');
this.name = 'NoRegistedDataSourceError';
}
}
exports.NoRegistedDataSourceError = NoRegistedDataSourceError;
class TypeOrmUpdatedPatchError extends TransactionalError {
constructor() {
super('It seems that TypeORM was updated. Patching "DataSource" is not safe. If you want to try to use the library, set the "patch" flag in the function "addTransactionalDataSource" to "false".');
this.name = 'TypeOrmUpdatedPatchError';
}
}
exports.TypeOrmUpdatedPatchError = TypeOrmUpdatedPatchError;
/**
* Error that occurs when a transaction is not rolled back
*/
class NotRollBackError extends TransactionalError {
constructor(
/**
* Original error that occurred during transaction
*/
originError) {
super(originError instanceof Error ? originError.message : 'NotRollBackError');
this.originError = originError;
}
}
exports.NotRollBackError = NotRollBackError;
//# sourceMappingURL=index.js.map