about summary refs log tree commit diff stats
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-25 20:26:59 +0200
committerAlan Pearce2024-06-25 20:29:58 +0200
commitd0877c0f99c8eb8070bdf001436b4d349779c06b (patch)
tree7f7025b1af20982a3f18a60d68b5b5ea74c44692 /internal/server/server.go
parentd2b554d23efb16a55856de0c28990e0f5aaad5bf (diff)
downloadwebsite-d0877c0f99c8eb8070bdf001436b4d349779c06b.tar.lz
website-d0877c0f99c8eb8070bdf001436b4d349779c06b.tar.zst
website-d0877c0f99c8eb8070bdf001436b4d349779c06b.zip
add missing error checks
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 02202ae..54c4569 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -151,11 +151,18 @@ func New(runtimeConfig *Config) (*Server, error) {
 			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)