Skip to content

Commit

Permalink
Do not emit error event if no error when getting the token
Browse files Browse the repository at this point in the history
  • Loading branch information
gtorodelvalle committed Sep 15, 2016
1 parent c21ac6d commit 7787517
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [BUG] Do not emit an error event if no error when getting the authentication token
4 changes: 3 additions & 1 deletion lib/fiwareDeviceSimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,9 @@ function requestToken(callback) {
(body && body.error && body.error.code) + ', title: ' + (body && body.error && body.error.title) +
', message: ' + (body && body.error && body.error.message) + ')');
}
emitError(error);
if (error) {
emitError(error);
}
return process.nextTick(callback.bind(null, error, response, body));
});
emitTokenRequest(tokenRequestOptions);
Expand Down

0 comments on commit 7787517

Please sign in to comment.