Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit 5149412

Browse files
committed
Give back errors
1 parent ac594b1 commit 5149412

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/network/protocol.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,16 @@ Protocol.prototype.handleClaim = function(params, callback) {
232232
try {
233233
contractObj = Contract.fromObject(params.contract);
234234
} catch (err) {
235+
callback(new Error('Invalid contract'));
235236
return;
236237
}
237238

238239
this._shouldSendOffer(contractObj, function(shouldSendOffer) {
239240
if (!shouldSendOffer) {
240-
return self._logger.debug('not sending an offer for the contract');
241+
// TODO give back a reason
242+
callback(new Error('Not accepting contracts'));
243+
self._logger.debug('not sending an offer for the contract');
244+
return;
241245
}
242246

243247
self._addContractToPendingList(contractObj);

0 commit comments

Comments
 (0)