Skip to content

Commit

Permalink
Throw if snapshotting closed database
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Aug 29, 2024
1 parent 2a8f19b commit 83dac8d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const binding = require('../binding')

module.exports = class RocksDBSnapshot {
constructor (db) {
if (db.opened === false) throw new Error('Database is not open')

this._db = db

this._handle = binding.snapshotCreate(db._handle)
Expand Down

0 comments on commit 83dac8d

Please sign in to comment.