Skip to content

Commit

Permalink
Manually apply a few more following logic from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweav committed Aug 23, 2024
1 parent 316d710 commit 7438520
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ func TestShardActiveNativeHistogramMetricsMiddlewareMergeResponseContextCancella
}()

cancelCause := "request canceled while streaming response"
cancel(fmt.Errorf("%s", cancelCause))
cancel(errors.New(cancelCause))

g.Wait()

Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/querymiddleware/shard_active_series_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func runTestShardActiveSeriesMiddlewareMergeResponseContextCancellation(t *testi
require.NoError(t, err)

cancelCause := "request canceled while streaming response"
cancel(fmt.Errorf("%s", cancelCause))
cancel(errors.New(cancelCause))

_, err = io.Copy(&buf, resp.Body)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/frontend/transport/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const (
)

var (
errCanceled = httpgrpc.Errorf(StatusClientClosedRequest, "%s", context.Canceled.Error())
errDeadlineExceeded = httpgrpc.Errorf(http.StatusGatewayTimeout, "%s", context.DeadlineExceeded.Error())
errCanceled = httpgrpc.Error(StatusClientClosedRequest, context.Canceled.Error())
errDeadlineExceeded = httpgrpc.Error(http.StatusGatewayTimeout, context.DeadlineExceeded.Error())
errRequestEntityTooLarge = httpgrpc.Errorf(http.StatusRequestEntityTooLarge, "http: request body too large")
)

Expand Down

0 comments on commit 7438520

Please sign in to comment.