mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
loki: backend: better error-handling-tests (#49213)
This commit is contained in:
parent
3da1bf160e
commit
78e22aac59
@ -74,8 +74,7 @@ func TestErrorResponse(t *testing.T) {
|
||||
// NOTE: when there is an error-response, it comes with
|
||||
// HTTP code 400, and the format seems to change between versions:
|
||||
// 2.3.x: content-type=text/plain, content is plaintext
|
||||
// 2.4.x: content-type=application/json, content is plaintext: https://github.com/grafana/loki/issues/4844
|
||||
// main-branch: content-type=application/json, content is JSON
|
||||
// 2.4.x+: content-type=application/json, content is plaintext: https://github.com/grafana/loki/issues/4844
|
||||
// we should always be able to to return some kind of error message
|
||||
tt := []struct {
|
||||
name string
|
||||
@ -95,7 +94,7 @@ func TestErrorResponse(t *testing.T) {
|
||||
errorMessage: "parse error at line 1, col 8: something is wrong",
|
||||
},
|
||||
{
|
||||
name: "parse a non-json error body with json content type (loki 2.4.0,2.4.1,2.4.2)",
|
||||
name: "parse a non-json error body with json content type",
|
||||
body: []byte("parse error at line 1, col 8: something is wrong"),
|
||||
contentType: "application/json; charset=UTF-8",
|
||||
errorMessage: "parse error at line 1, col 8: something is wrong",
|
||||
|
Loading…
Reference in New Issue
Block a user