summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-05 21:05:23 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-05 21:05:23 -0600
commitcc8b6289ac3f7d1abb648217949beb89827d7374 (patch)
tree82ddd158dbeb80ac5c8c1da020481ceaa3bf766a
parent39ad0e614f6c97595710b4d8f535b41f0d83aa0e (diff)
Improve fatal message for mailinglist.Store creation
-rw-r--r--srv/cmd/mailinglist-cli/main.go6
-rw-r--r--srv/cmd/mediocre-blog/main.go5
2 files changed, 8 insertions, 3 deletions
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)
}