From 73727e8fb6ea5795eab2eadfed548673e49006d0 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 13 Aug 2020 15:36:35 +0200 Subject: [PATCH 1/2] Align error behaviour for invalid web config path with invalid asset path --- pkg/service/v0/service.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 5c2e3e5b5e..6545a9f36d 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -79,21 +79,19 @@ func (p Phoenix) getPayload() (payload []byte, err error) { // try loading from file if _, err = os.Stat(p.config.Phoenix.Path); os.IsNotExist(err) { - p.logger.Error(). + p.logger.Fatal(). Err(err). Str("config", p.config.Phoenix.Path). - Msg("Phoenix config doesn't exist") - return + Msg("phoenix config doesn't exist") } payload, err = ioutil.ReadFile(p.config.Phoenix.Path) if err != nil { - p.logger.Error(). + p.logger.Fatal(). Err(err). Str("config", p.config.Phoenix.Path). - Msg("Failed to read custom config") - + Msg("failed to read custom config") } return } From 2da46c6495de330ed7a6a3b48d6b64137dea8481 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 13 Aug 2020 15:39:10 +0200 Subject: [PATCH 2/2] Adapt changelog for missing config --- changelog/unreleased/exit-on-unresolved-assets.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/exit-on-unresolved-assets.md b/changelog/unreleased/exit-on-unresolved-assets.md index 0d639dc518..75efdea80a 100644 --- a/changelog/unreleased/exit-on-unresolved-assets.md +++ b/changelog/unreleased/exit-on-unresolved-assets.md @@ -1,7 +1,10 @@ -Bugfix: exit when assets are not found +Bugfix: exit when assets or config are not found -When a non-existing assets folders is specified, there was only a warning log statement and the service served +When a non-existing assets folder is specified, there was only a warning log statement and the service served the builtin assets instead. It is safe to exit the service in such a scenario, instead of serving other assets than specified. We changed the log level to `Fatal` on non-existing assets. +Similar for the web config, it was not failing on service level, but only showing an error in the web ui, wenn +the specified config file could not be found. We changed the log level to `Fatal` as well. https://github.com/owncloud/ocis-phoenix/pull/76 +https://github.com/owncloud/ocis-phoenix/pull/77