-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error source handler middleware #1101
Conversation
309bfc7
to
b95ac03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an expert in the topic but code-wise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Great job @marefr.
require.Equal(t, tc.expErrorSource, ss) | ||
}) | ||
} | ||
}) | ||
|
||
t.Run("QueryData response without valid error source error should set error source", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few things
Adds an error source handler middleware that can be used both within the SDK and in Grafana.
Still left to share the error source handler middleware logic with the existing auto instrumentation in https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/adapter_utils.go and https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/data_adapter.go.
Ref #1082