Skip to content

Commit

Permalink
Fix error handling of preput/del/batch
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Mar 20, 2022
1 parent 40bc944 commit 747b8d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions host.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function createRpcStream (db, options, streamOptions) {

function onput (req) {
preput(req.key, req.value, function (err) {
if (err) return callback(err)
if (err) return callback(req.id, err)
db.put(req.key, req.value, encodingOptions, function (err) {
callback(req.id, err, null)
})
Expand All @@ -155,7 +155,7 @@ function createRpcStream (db, options, streamOptions) {

function ondel (req) {
predel(req.key, function (err) {
if (err) return callback(err)
if (err) return callback(req.id, err)
db.del(req.key, encodingOptions, function (err) {
callback(req.id, err)
})
Expand All @@ -168,7 +168,7 @@ function createRpcStream (db, options, streamOptions) {

function onbatch (req) {
prebatch(req.ops, function (err) {
if (err) return callback(err)
if (err) return callback(req.id, err)

db.batch(req.ops, encodingOptions, function (err) {
callback(req.id, err)
Expand Down

0 comments on commit 747b8d4

Please sign in to comment.