Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from Cox-Automotive/betterLogging
Browse files Browse the repository at this point in the history
Better Error Response
  • Loading branch information
amagana3 committed Jul 10, 2020
2 parents bd5a9ba + e31febd commit 490a8ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
node_modules

.idea/*
3 changes: 2 additions & 1 deletion lib/alks-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ exports.refreshTokenToAccessToken = function(account, token, opts, callback){
}
}, function(err, results){
if(err){
return callback(err);
// [AM] - This is when we get a 500, which is (in ALKS Core) a bad refresh token. Should pass this error to the CLI.
return callback("Error: Refresh token expired. Please try to use the logout2fa and login2fa commands.");
}
else if(results.statusCode !== 200){
return callback(new Error(getMessageFromBadResponse(results)));
Expand Down

0 comments on commit 490a8ed

Please sign in to comment.