Fix typo in twirp server status code parsing (#1361)
This commit is contained in:
@@ -184,14 +184,14 @@ func statusReporterResponseSent(ctx context.Context) {
|
|||||||
|
|
||||||
var statusFamily string
|
var statusFamily string
|
||||||
if statusCode, ok := twirp.StatusCode(ctx); ok {
|
if statusCode, ok := twirp.StatusCode(ctx); ok {
|
||||||
if status, err := strconv.Atoi(statusCode); err != nil {
|
if status, err := strconv.Atoi(statusCode); err == nil {
|
||||||
switch {
|
switch {
|
||||||
case status >= 400 && status <= 499:
|
case status >= 400 && status <= 499:
|
||||||
statusFamily = "4xx"
|
statusFamily = "4xx"
|
||||||
case status >= 500 && status <= 599:
|
case status >= 500 && status <= 599:
|
||||||
statusFamily = "5xx"
|
statusFamily = "5xx"
|
||||||
default:
|
default:
|
||||||
statusFamily = strconv.Itoa(status)
|
statusFamily = statusCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user