Commit df33cbc8 by Donn Pebe

Fix wrong metrics counter

parent a38a06a0
......@@ -87,10 +87,10 @@ func ApiError(status int, message string, err error) *NormalResponse {
switch status {
case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500:
metrics.M_Api_Status_404.Inc(1)
metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error"
}
......
......@@ -197,10 +197,10 @@ func (ctx *Context) JsonApiErr(status int, message string, err error) {
switch status {
case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500:
metrics.M_Api_Status_404.Inc(1)
metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment