summaryrefslogtreecommitdiffhomepage
path: root/src/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.go')
-rw-r--r--src/http.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http.go b/src/http.go
index a5897b4..6feb865 100644
--- a/src/http.go
+++ b/src/http.go
@@ -12,6 +12,8 @@ import (
"strconv"
"strings"
+ . "git.thomasvoss.com/euro-cash.eu/pkg/try"
+
"git.thomasvoss.com/euro-cash.eu/src/dbx"
"git.thomasvoss.com/euro-cash.eu/src/email"
)
@@ -41,9 +43,7 @@ func Run(port int) {
portStr := ":" + strconv.Itoa(port)
log.Println("Listening on", portStr)
- err := http.ListenAndServe(portStr, mux)
- dbx.Close()
- log.Fatal(err)
+ Try(http.ListenAndServe(portStr, mux))
}
func chain(xs ...middleware) middleware {
@@ -179,7 +179,7 @@ func throwError(status int, err error, w http.ResponseWriter, r *http.Request) {
w.WriteHeader(status)
go func() {
if err := email.ServerError(err); err != nil {
- log.Print(err)
+ log.Println(err)
}
}()
errorTmpl.Execute(w, struct {