From cc8b6289ac3f7d1abb648217949beb89827d7374 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 5 May 2022 21:05:23 -0600 Subject: Improve fatal message for mailinglist.Store creation --- srv/cmd/mailinglist-cli/main.go | 6 ++++-- srv/cmd/mediocre-blog/main.go | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'srv') diff --git a/srv/cmd/mailinglist-cli/main.go b/srv/cmd/mailinglist-cli/main.go index a44dadd..c3207df 100644 --- a/srv/cmd/mailinglist-cli/main.go +++ b/srv/cmd/mailinglist-cli/main.go @@ -54,7 +54,10 @@ func main() { mailer = mailinglist.NewMailer(mailerParams) } - mlStore, err := mailinglist.NewStore(path.Join(*dataDir, "mailinglist.sqlite3")) + mailingListDBFile := path.Join(*dataDir, "mailinglist.sqlite3") + ctx = mctx.Annotate(ctx, "mailingListDBFile", mailingListDBFile) + + mlStore, err := mailinglist.NewStore(mailingListDBFile) if err != nil { logger.Fatal(ctx, "initializing mailing list storage", err) } @@ -65,7 +68,6 @@ func main() { mlParams.Clock = clock ml := mailinglist.New(mlParams) - _ = ml subCmd := cfg.SubCmd() ctx = mctx.Annotate(ctx, "subCmd", subCmd) diff --git a/srv/cmd/mediocre-blog/main.go b/srv/cmd/mediocre-blog/main.go index 7ff3743..4cf3024 100644 --- a/srv/cmd/mediocre-blog/main.go +++ b/srv/cmd/mediocre-blog/main.go @@ -91,7 +91,10 @@ func main() { mailer = mailinglist.NewMailer(mailerParams) } - mlStore, err := mailinglist.NewStore(path.Join(*dataDir, "mailinglist.sqlite3")) + mailingListDBFile := path.Join(*dataDir, "mailinglist.sqlite3") + ctx = mctx.Annotate(ctx, "mailingListDBFile", mailingListDBFile) + + mlStore, err := mailinglist.NewStore(mailingListDBFile) if err != nil { logger.Fatal(ctx, "initializing mailing list storage", err) } -- cgit v1.2.3