cleanup
alex wennerberg alex@alexwennerberg.com
Mon, 26 Oct 2020 19:45:25 -0700
1 files changed,
7 insertions(+),
3 deletions(-)
jump to
M
gemini.go
→
gemini.go
@@ -19,8 +19,12 @@ t, err := template.ParseFiles("templates/index.gmi")
if err != nil { log.Fatal(err) } - files, _ := getIndexFiles() - users, _ := getUsers() + files, err := getIndexFiles() + users, err := getUsers() + if err != nil { + log.Println(err) + w.WriteHeader(40, "Internal server error") + } data := struct { Host string SiteTitle string@@ -54,7 +58,7 @@ mimetype := mime.TypeByExtension(ext)
w.SetMimetype(mimetype) _, err = w.Write(data) if err != nil { - log.Fatal(err) + log.Println(err) w.WriteHeader(40, "Internal server error") return }