Skip to content

Commit

Permalink
Correct key-value
Browse files Browse the repository at this point in the history
  • Loading branch information
punmechanic committed Nov 12, 2024
1 parent 0a57be4 commit 1277d79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/api/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ func ServeJSON[T any](w http.ResponseWriter, data T) {
buf, err := json.Marshal(data)
if err != nil {
// Nothing to be done here
slog.Error("could not marshal JSON: %s", err)
slog.Error("could not marshal JSON: %s", "error", err)
return
}

// Nothing we can do to respond to the error message here either
w.Header().Set("Content-Type", "application/json")
_, err = w.Write(buf)
slog.Error("could not write JSON to the client: %s", err)
slog.Error("could not write JSON to the client: %s", "error", err)
}

type JSONError struct {
Expand Down

0 comments on commit 1277d79

Please sign in to comment.