Skip to content

Commit

Permalink
Merge pull request #84 from gtorodelvalle/bug/do-not-emit-error-if-no…
Browse files Browse the repository at this point in the history
…-error-when-retrieving-token

Do not emit error event if no error when getting the token
  • Loading branch information
gtorodelvalle authored Sep 15, 2016
2 parents c21ac6d + 7787517 commit fb4c20e
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 fb4c20e

Please sign in to comment.