diff --git a/src/stateAggregator/accessors/orgAccessor.ts b/src/stateAggregator/accessors/orgAccessor.ts index c1ae2d3cd7..603577b4a4 100644 --- a/src/stateAggregator/accessors/orgAccessor.ts +++ b/src/stateAggregator/accessors/orgAccessor.ts @@ -16,6 +16,7 @@ import { ConfigFile } from '../../config/configFile'; import { ConfigContents } from '../../config/configStore'; import { Logger } from '../../logger'; import { Messages } from '../../messages'; +import { Lifecycle } from '../../lifecycleEvents'; function chunk(array: T[], chunkSize: number): T[][] { const final = []; @@ -55,8 +56,12 @@ export abstract class BaseOrgAccessor { const username = this.parseUsername(f); - const config = await this.initAuthFile(username); - this.configs.set(username, config); + try { + const config = await this.initAuthFile(username); + this.configs.set(username, config); + } catch (e) { + await Lifecycle.getInstance().emitWarning(`The auth file for ${username} is invalid.`); + } }); // eslint-disable-next-line no-await-in-loop await Promise.all(promises);