Skip to content

Commit

Permalink
[FIX] #220 - changed example to test for instanceof NatsError
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
aricart committed Apr 20, 2018
1 parent 8d999f1 commit 7a7b67d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ nats.request('help', null, {'max':1}, function(response) {
// Request for single response with timeout.
nats.requestOne('help', null, {}, 1000, function(response) {
// `NATS` is the library.
if(response.code && response.code === NATS.REQ_TIMEOUT) {
if(response instanceof NATS.NatsError && response.code === NATS.REQ_TIMEOUT) {
console.log('Request for help timed out.');
return;
}
Expand Down

0 comments on commit 7a7b67d

Please sign in to comment.