Skip to content

Commit

Permalink
thow error if not trust is found
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jul 16, 2024
1 parent 84d7b55 commit a3c3134
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/models/keystone.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ function getToken(trust, callback) {
// check trust was found or log it
if (!trustConf) {
logger.error('Trust %s not found in configTrust file with content %j', trust, configTrust);
alarm.raise(alarm.AUTH);
callback(new errors.TokenRetrievalError(trust, 'trust not found' + trust));
throw errors.TokenRetrievalError(trust, 'trust not found' + trust);
}
var options = {
url: 'http://' + trustConf.host + ':' + trustConf.port + '/v3/auth/tokens',
Expand Down
4 changes: 2 additions & 2 deletions lib/models/updateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ function doRequestV2(action, event, token, callback) {
function makeTokenListenerFunc(action, event, version, callback) {
return function tokenHandlerFunc(error, token) {
logger.debug('tokenHandlerFunc error:%s token:%s', error, token);
if (error) {
throw error;
if (error || !token) {
return callback(error);
} else {
logger.debug('tokenHandlerFunc retrying with %s', token);
return doRequestV2(action, event, token, function cbDoReqUpdAxn(error, data) {
Expand Down

0 comments on commit a3c3134

Please sign in to comment.