SSE: Return error messages instead of 500 on SSE command parse errors (#109480)
fixes #108897 --------- Co-authored-by: Kyle Brandt <kyle@grafana.com>
This commit is contained in:
co-authored by
Kyle Brandt
parent
76af73b3f3
commit
bdf9583ada
@@ -148,6 +148,25 @@ func TestDSQueryError(t *testing.T) {
|
||||
require.Equal(t, fp(42), res.Responses["C"].Frames[0].Fields[0].At(0))
|
||||
}
|
||||
|
||||
func TestParseError(t *testing.T) {
|
||||
resp := map[string]backend.DataResponse{}
|
||||
|
||||
queries := []Query{
|
||||
{
|
||||
RefID: "A",
|
||||
DataSource: dataSourceModel(),
|
||||
JSON: json.RawMessage(`{ "datasource": { "uid": "__expr__", "type": "__expr__"}, "type": "math", "expression": "asdf" }`),
|
||||
},
|
||||
}
|
||||
|
||||
s, req := newMockQueryService(resp, queries)
|
||||
|
||||
_, err := s.BuildPipeline(t.Context(), req)
|
||||
require.ErrorContains(t, err, "parse")
|
||||
require.ErrorContains(t, err, "math")
|
||||
require.ErrorContains(t, err, "asdf")
|
||||
}
|
||||
|
||||
func TestSQLExpressionCellLimitFromConfig(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user