Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop network error trading a token request for a token failing the connection #419

Merged
merged 1 commit into from
Oct 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion common/lib/client/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ var Auth = (function() {

if(err) {
Logger.logAction(Logger.LOG_ERROR, 'Auth.requestToken()', 'token request signing call returned error; err = ' + Utils.inspectError(err));
if(!(err && err.code)) {
if(!err.code) {
/* network errors don't have an error code, so assign them
* 40170 so they'll by connectionManager as nonfatal */
err = new ErrorInfo(Utils.inspectError(err), 40170, 401);
Expand Down Expand Up @@ -437,6 +437,11 @@ var Auth = (function() {
tokenRequest(tokenRequestOrDetails, function(err, tokenResponse, headers, unpacked) {
if(err) {
Logger.logAction(Logger.LOG_ERROR, 'Auth.requestToken()', 'token request API call returned error; err = ' + Utils.inspectError(err));
if(!err.code) {
/* network errors don't have an error code, so assign them
* 40170 so they'll be seen by connectionManager as nonfatal */
err = new ErrorInfo(Utils.inspectError(err), 40170, 401);
}
callback(err);
return;
}
Expand Down