more logs since k6 is fucked
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s

This commit is contained in:
matst80
2024-11-13 11:42:51 +01:00
parent 3afffe7815
commit 7cc9b48720
2 changed files with 5 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"log"
"net/http"
"strconv"
@@ -47,6 +48,7 @@ func ErrorHandler(fn func(w http.ResponseWriter, r *http.Request) error) func(w
return func(w http.ResponseWriter, r *http.Request) {
err := fn(w, r)
if err != nil {
log.Printf("Server error, not remote error: %v\n", err)
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
}
@@ -57,6 +59,7 @@ func (s *PoolServer) WriteResult(w http.ResponseWriter, result *CallResult) erro
w.Header().Set("Content-Type", "application/json")
w.Header().Set("X-Pod-Name", s.pod_name)
if result.StatusCode != 200 {
log.Printf("Call error: %d\n", result.StatusCode)
if result.StatusCode >= 200 && result.StatusCode < 600 {
w.WriteHeader(int(result.StatusCode))
} else {