Skip to content

Commit

Permalink
Translate errors to PromQL errors by wrapping queryable. (grafana#2941)
Browse files Browse the repository at this point in the history
* Initial version.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>

* Move PromQL API error translation to querier registration.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>

* Remove extra use of promql.ErrStorage.

All unknown errors are translated to promql.ErrStorage
already at API level of the querier.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>

* Updated CHANGELOG.md entry.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>

* Treat context.Canceled as user error and return 422.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>

* Added test for context.DeadlineExceeded.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
  • Loading branch information
pstibrany authored Jul 31, 2020
1 parent 9a099c1 commit c4d691e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chunk_store_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func (c *Fetcher) FetchChunks(ctx context.Context, chunks []Chunk, keys []string
}

if err != nil {
// Don't rely on Cortex error translation here.
return nil, promql.ErrStorage{Err: err}
}

Expand Down

0 comments on commit c4d691e

Please sign in to comment.