Logging and deps

This commit is contained in:
2024-05-08 14:43:57 -06:00
parent 994a2fabd6
commit 8fed511607
8 changed files with 63 additions and 43 deletions

View File

@ -22,7 +22,7 @@ func Blog(c echo.Context) error {
files, err := fs.ReadDir(contentfs.FS, ".")
if err != nil {
log.Println(err)
lib.LogError.Println(err)
http.Error(c.Response().Writer, "There was an issue finding posts!", http.StatusInternalServerError)
return nil
}
@ -31,7 +31,7 @@ func Blog(c echo.Context) error {
if !file.IsDir() && strings.HasSuffix(file.Name(), ".md") {
frontMatter, err := lib.ExtractFrontMatter(file, contentfs.FS)
if err != nil {
log.Println(err)
lib.LogError.Println(err)
http.Error(c.Response().Writer, "There was an issue rendering the posts!", http.StatusInternalServerError)
return nil
}