all repos — flounder @ 2e24c3a6f64f2e2f8a9e2179e8b692dd6b13de54

A small site builder for the Gemini protocol

cleanup
alex wennerberg alex@alexwennerberg.com
Mon, 26 Oct 2020 19:45:25 -0700
commit

2e24c3a6f64f2e2f8a9e2179e8b692dd6b13de54

parent

b626eb0a83d6ee8c62d82154dd2a44badcedfeb6

1 files changed, 7 insertions(+), 3 deletions(-)

jump to
M gemini.gogemini.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 }