From 2fc9527a17a407ec447ef690e72516cee646c66e Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Mon, 19 Jun 2023 07:30:20 +0000 Subject: [PATCH] Fatally exit on http server error --- server/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.go b/server/main.go index 5bedf7e..972c496 100644 --- a/server/main.go +++ b/server/main.go @@ -363,7 +363,7 @@ func completion(w http.ResponseWriter, req *http.Request) { } resp, err := c.CreateCompletion(ctx, req) if err != nil { - log.Println("Error Failed to generate: ", err) + log.Println("Error Failed to generate, failed to create completion: ", err) w.WriteHeader(http.StatusInternalServerError) return } @@ -490,6 +490,6 @@ func main() { portString := ":8090" log.Println("DO NOT RUN WITH CLOUDFLARE PROXY it rate limits based on IP, if behind proxy every IP will be the same. Would need to fix req.RemoteAddr. Serving on " + portString + "...") - http.ListenAndServe(portString, nil) + log.Fatal(http.ListenAndServe(portString, nil)) }