Improve fatal message for mailinglist.Store creation

This commit is contained in:
Brian Picciano 2022-05-05 21:05:23 -06:00
parent 39ad0e614f
commit cc8b6289ac
2 changed files with 8 additions and 3 deletions

View File

@ -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)

View File

@ -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)
}