aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/about/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/handler/about/handler.go')
-rw-r--r--pkg/handler/about/handler.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg/handler/about/handler.go b/pkg/handler/about/handler.go
index 1acde60..ac3d314 100644
--- a/pkg/handler/about/handler.go
+++ b/pkg/handler/about/handler.go
@@ -2,7 +2,6 @@ package about
import (
"io"
- "log/slog"
"net/http"
"os"
@@ -27,17 +26,15 @@ func NewAboutHandler(configRepo configurationRepository) *AboutHandler {
return &AboutHandler{configRepo.GetRootReadme()}
}
-func (g *AboutHandler) About(w http.ResponseWriter, _ *http.Request) {
+func (g *AboutHandler) About(w http.ResponseWriter, _ *http.Request) error {
f, err := os.Open(g.readmePath)
if err != nil {
- slog.Error("Error loading readme file", "error", err)
- return
+ return err
}
bs, err := io.ReadAll(f)
if err != nil {
- slog.Error("Error reading readme file bytes", "error", err)
- return
+ return err
}
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
@@ -54,4 +51,5 @@ func (g *AboutHandler) About(w http.ResponseWriter, _ *http.Request) {
Body: bs,
}
templates.WritePageTemplate(w, gitList)
+ return nil
}