diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e69de29b..a1191de3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -0,0 +1 @@ +- Fix: do not invoke calback twice when error about trust not found in trustConf (#790) diff --git a/lib/models/keystone.js b/lib/models/keystone.js index 1fd2516b..0d23eb85 100644 --- a/lib/models/keystone.js +++ b/lib/models/keystone.js @@ -59,8 +59,8 @@ function getToken(trust, callback) { // check trust was found or log it if (!trustConf) { - logger.error('Trust %s not found in configTrust file with content %s', trust, configTrust); - callback(new errors.TokenRetrievalError(trust, 'trust not found' + trust)); + logger.error('Trust %s not found in configTrust file', trust); + throw errors.TokenRetrievalError(trust, 'trust not found' + trust); } var options = { url: 'http://' + trustConf.host + ':' + trustConf.port + '/v3/auth/tokens', diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index b9cbf3f4..a40e23d0 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -477,7 +477,7 @@ function makeTokenListenerFunc(action, event, version, callback) { if (error || !token) { return callback(error); } else { - logger.debug('tokenHandlerFunc retrying with', token); + logger.debug('tokenHandlerFunc retrying with %s', token); return doRequestV2(action, event, token, function cbDoReqUpdAxn(error, data) { callback(error, data); });