From 747b8d45786363cbc878458cab0f6df92e30bd29 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 20 Mar 2022 16:53:22 +0100 Subject: [PATCH] Fix error handling of preput/del/batch --- host.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host.js b/host.js index 833202b..513c6dc 100644 --- a/host.js +++ b/host.js @@ -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) }) @@ -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) }) @@ -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)