diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-06-14 00:41:55 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-06-14 00:41:55 +0200 |
commit | 2d5ca3a6cd507ef29eb13b3a78232264a2817e81 (patch) | |
tree | e69629fc56041344e7ad7221ec841d9bd87fae8d /src | |
parent | 99313edd6f3621b21c38dc2323f19480ea64617f (diff) |
Use Try()
Diffstat (limited to 'src')
-rw-r--r-- | src/http.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/http.go b/src/http.go index 298e6be..babf7f8 100644 --- a/src/http.go +++ b/src/http.go @@ -14,6 +14,7 @@ import ( "git.thomasvoss.com/euro-cash.eu/src/dbx" "git.thomasvoss.com/euro-cash.eu/src/email" + . "git.thomasvoss.com/euro-cash.eu/src/try" ) type middleware = func(http.Handler) http.Handler @@ -41,9 +42,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 { |