diff --git a/src/lib/features/maintenance/maintenance-service.ts b/src/lib/features/maintenance/maintenance-service.ts index 5e2fa6c881cc..a60267b426fd 100644 --- a/src/lib/features/maintenance/maintenance-service.ts +++ b/src/lib/features/maintenance/maintenance-service.ts @@ -33,19 +33,22 @@ export default class MaintenanceService implements IMaintenanceStatus { } async isMaintenanceMode(): Promise { - return ( - this.config.flagResolver.isEnabled('maintenanceMode') || - (await this.resolveMaintenance()) - ); + try { + return ( + this.config.flagResolver.isEnabled('maintenanceMode') || + (await this.resolveMaintenance()) + ); + } catch (e) { + this.logger.warn('Error checking maintenance mode', e); + return false; + } } async getMaintenanceSetting(): Promise { this.logger.debug('getMaintenanceSetting called'); - return ( - (await this.settingService.get(maintenanceSettingsKey)) || { - enabled: false, - } - ); + return this.settingService.getWithDefault(maintenanceSettingsKey, { + enabled: false, + }); } async toggleMaintenanceMode( diff --git a/src/lib/services/version-service.ts b/src/lib/services/version-service.ts index 4cd56a2f6bed..a966490ac678 100644 --- a/src/lib/services/version-service.ts +++ b/src/lib/services/version-service.ts @@ -193,7 +193,7 @@ export default class VersionService { )) ?? { id: undefined }; this.instanceId = id; } catch (err) { - this.logger.warn('Could not find instanceInfo'); + this.logger.warn('Could not find instanceInfo', err); } }