Skip to content

Commit

Permalink
Release v3.1.3: clarify error message (fixes #14)
Browse files Browse the repository at this point in the history
  • Loading branch information
vphantom committed Aug 10, 2019
1 parent 3f61a12 commit 27683f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jrpc v3.1.2
# jrpc v3.1.3

[![Build Status](https://travis-ci.org/vphantom/js-jrpc.svg?branch=v3.1.2)](https://travis-ci.org/vphantom/js-jrpc) [![Coverage Status](https://coveralls.io/repos/github/vphantom/js-jrpc/badge.svg?branch=v3.1.2)](https://coveralls.io/github/vphantom/js-jrpc?branch=v3.1.2)
[![Build Status](https://travis-ci.org/vphantom/js-jrpc.svg?branch=v3.1.3)](https://travis-ci.org/vphantom/js-jrpc) [![Coverage Status](https://coveralls.io/repos/github/vphantom/js-jrpc/badge.svg?branch=v3.1.3)](https://coveralls.io/github/vphantom/js-jrpc?branch=v3.1.3)

Streaming bidirectional backwards-compatible extended JSON-RPC 2.0 in JavaScript

Expand Down
36 changes: 25 additions & 11 deletions jrpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,31 @@ function call(methodName, params, next) {
return this;
}
if (this.remoteTimeout > 0) {
this.outTimers[this.serial] = setTimeout(
deliverResponse.bind(this, {
jsonrpc: '2.0',
id: this.serial,
error: {
code: -1000,
message: 'Timed out waiting for response'
}
}),
this.remoteTimeout
);
if (typeof this.transmitter === 'function') {
this.outTimers[this.serial] = setTimeout(
deliverResponse.bind(this, {
jsonrpc: '2.0',
id: this.serial,
error: {
code: -1000,
message: 'Timed out waiting for response'
}
}),
this.remoteTimeout
);
} else {
this.outTimers[this.serial] = setTimeout(
deliverResponse.bind(this, {
jsonrpc: '2.0',
id: this.serial,
error: {
code: -1100,
message: 'Timed out before transmitter was set'
}
}),
this.remoteTimeout
);
}
} else {
this.outTimers[this.serial] = true; // Placeholder
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jrpc",
"version": "3.1.2",
"version": "3.1.3",
"description": "Streaming bidirectional backwards-compatible extended JSON-RPC 2.0 in JavaScript",
"main": "jrpc.js",
"scripts": {
Expand Down Expand Up @@ -30,6 +30,7 @@
"coveralls": "^2.11.9",
"faucet": "0.0.1",
"istanbul": "^0.4.3",
"tape": "^4.5.1"
"tape": "^4.5.1",
"phantomjs": "^2.1.7"
}
}

0 comments on commit 27683f9

Please sign in to comment.