New error handling added to getRequestBody function in data package
This commit is contained in:
@@ -13,7 +13,7 @@ func WriteErrorResponse(statusCode int, reasonMsg string, res http.ResponseWrite
|
||||
respBody := ServerErrMessage{}
|
||||
respBody.Reason = reasonMsg
|
||||
bb, _ := json.Marshal(respBody)
|
||||
res.Header().Add("Content-Type", "application/json; charset=utf-8")
|
||||
res.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
res.WriteHeader(statusCode)
|
||||
_, _ = res.Write(bb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user