diff options
author | Alan Pearce | 2024-06-25 20:26:59 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-25 20:29:58 +0200 |
commit | d0877c0f99c8eb8070bdf001436b4d349779c06b (patch) | |
tree | 7f7025b1af20982a3f18a60d68b5b5ea74c44692 /internal | |
parent | d2b554d23efb16a55856de0c28990e0f5aaad5bf (diff) | |
download | website-d0877c0f99c8eb8070bdf001436b4d349779c06b.tar.lz website-d0877c0f99c8eb8070bdf001436b4d349779c06b.tar.zst website-d0877c0f99c8eb8070bdf001436b4d349779c06b.zip |
add missing error checks
Diffstat (limited to 'internal')
-rw-r--r-- | internal/server/server.go | 11 |
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) |