diff --git a/core/src/server/instance-manager.ts b/core/src/server/instance-manager.ts index 38ee99969f..073644f19c 100644 --- a/core/src/server/instance-manager.ts +++ b/core/src/server/instance-manager.ts @@ -236,7 +236,7 @@ export class GardenInstanceManager { // Flag the instance for reloading when configs change garden.events.once("configChanged", (_payload) => { - if (!garden.needsReload) { + if (!garden.needsReload()) { garden.needsReload(true) garden.log.info( chalk.magenta.bold( diff --git a/core/src/server/server.ts b/core/src/server/server.ts index 7972f807cf..471fbaa0b5 100644 --- a/core/src/server/server.ts +++ b/core/src/server/server.ts @@ -884,22 +884,25 @@ export class GardenServer extends EventEmitter { }) let graph: ConfigGraph | undefined - let errors: GardenError[] = [] + let error: GardenError | undefined try { graph = await garden.getConfigGraph({ log, emit: true }) - loadConfigLog.success("Config loaded") - } catch (error) { - errors.push(toGardenError(error)) + } catch (err) { + error = toGardenError(err) } finally { - loadConfigLog.success(`Loading config failed with error: ${errors[0].message}`) + if (error) { + loadConfigLog.error(`Loading config failed with error: ${error.message}`) + } else { + loadConfigLog.success("Config loaded") + } await cloudEventStream.close() // Note: This also flushes events send( "commandResult", sanitizeValue({ requestId, result: graph, - errors, + errors: [error], }) ) }