this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 15 lines 404 B view raw
1package utility 2 3import ( 4 "encoding/json" 5 "net/http" 6 7 "github.com/eagleusb/proxycon/internal/types" 8) 9 10// WriteJSONError writes a JSON-formatted error response for consistency. 11func WriteJSONError(w http.ResponseWriter, message string, code int) { 12 w.Header().Set("Content-Type", "application/json") 13 w.WriteHeader(code) 14 json.NewEncoder(w).Encode(types.ErrorResponse{Code: code, Message: message}) 15}