Skip to content

Commit 2ec61e0

Browse files
author
matehat
committed
Omit providing an error when unnecessary (in protobuf api)
1 parent cb6158b commit 2ec61e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/protocol-buffers-client.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var ProtocolBuffersClient = function ProtocolBuffersClient(options) {
1717
this.mapreduce = new ProtocolBuffersMapReduceClient(this._defaults, execute);
1818
}
1919

20+
var expectedResponseOperations = ['get', 'getBucket', 'getBuckets', 'keys'];
21+
2022
util.inherits(ProtocolBuffersClient, Client);
2123

2224
ProtocolBuffersClient.prototype.get = function(bucket, key, options, callback) {
@@ -89,7 +91,7 @@ ProtocolBuffersClient.prototype._execute = function(operation, meta, includePara
8991
data = meta.parse(response.content[0].value);
9092
}
9193

92-
if (Object.keys(response).length == 0) {
94+
if (expectedResponseOperations.indexOf(operation) > -1 && Object.keys(response).length == 0) {
9395
error = {notFound: true};
9496
}
9597

0 commit comments

Comments
 (0)