loosen check for security exception and log metadata so we can investigate "offline"

This commit is contained in:
spalger 2019-05-21 20:24:33 -07:00
parent a189392c77
commit 8d7e1237bb

View file

@ -44,8 +44,11 @@ exports.NativeRealm = class NativeRealm {
},
});
} catch (error) {
if (attempt < 3 && error.meta && error.meta.statusCode === 401) {
this._log.warning('[elastic] user not available yet, waiting 1.5 seconds and trying again');
if (attempt < 3) {
this._log.warning(
'assuming that [elastic] user not available yet, waiting 1.5 seconds and trying again'
);
this._log.info(' -- error.meta', error.meta);
await new Promise(resolve => setTimeout(resolve, 1500));
return await this.setPassword(username, password, {
attempt: attempt + 1,