all repos — website @ d0877c0f99c8eb8070bdf001436b4d349779c06b

My website

add missing error checks
Alan Pearce alan@alanpearce.eu
Tue, 25 Jun 2024 20:26:59 +0200
commit

d0877c0f99c8eb8070bdf001436b4d349779c06b

parent

d2b554d23efb16a55856de0c28990e0f5aaad5bf

1 files changed, 9 insertions(+), 2 deletions(-)

jump to
M internal/server/server.gointernal/server/server.go
@@ -151,11 +151,18 @@ if err != nil { 			return nil, errors.WithMessage(err, "could not add directory to file watcher")
 		}
 		go fw.Start(func(filename string) {
-			rebuild(builderConfig, config)
+			log.Info("rebuilding site", "changed_file", filename)
+			err := rebuild(builderConfig, config)
+			if err != nil {
+				log.Error("error rebuilding site", "error", err)
+			}
 		})
 	}
 
-	rebuild(builderConfig, config)
+	err = rebuild(builderConfig, config)
+	if err != nil {
+		return nil, err
+	}
 
 	loggingMux := http.NewServeMux()
 	mux, err := website.NewMux(config, runtimeConfig.Root)