SSE: Use errutil to show better error messages in prod (#71658)
- include public message - propagate data source query errors so they are shown as well to which fixes #70026
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package expr_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/expr"
|
||||
"github.com/grafana/grafana/pkg/util/errutil"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestQueryErrorType(t *testing.T) {
|
||||
qet := expr.QueryError
|
||||
utilError := errutil.Error{}
|
||||
qe := expr.MakeQueryError("A", "", fmt.Errorf("not work"))
|
||||
|
||||
require.True(t, errors.Is(qe, qet))
|
||||
require.True(t, errors.As(qe, &utilError))
|
||||
}
|
||||
Reference in New Issue
Block a user