Skip to content

Commit

Permalink
Check error
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Imperiale <[email protected]>
  • Loading branch information
manuio committed Jan 11, 2022
1 parent c7f534b commit 794e871
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion health.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ func Health(service string) http.HandlerFunc {
Version: version,
}

if err := json.NewEncoder(w).Encode(res); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}

w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(res)
})
}

0 comments on commit 794e871

Please sign in to comment.