Skip to content
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

Improve error handling for invalid queries #65

Merged
merged 1 commit into from
May 12, 2022

Conversation

nineinchnick
Copy link
Contributor

When the frontend sends an invalid query, the backend plugin will panic because it tries to decode error frames from a nil object. Also, the actual error message from the JSON decoder is not returned or logged. This PR tries to address this.

Copy link
Collaborator

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch @nineinchnick! I have a small suggestion here.

query.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@andresmgot andresmgot merged commit 0f7924c into grafana:main May 12, 2022
@andresmgot
Copy link
Collaborator

andresmgot commented May 12, 2022

released 2.3.8 with your change so it can be used by plugins

@nineinchnick nineinchnick deleted the handle-invalid-queries branch May 12, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants