This PR takes care of false-positive plugin errors identified in https://ops.grafana-ops.net/goto/BHCltU6SR?orgId=1. The main issue is that if users input invalid Google JWT information - for example incorrect email:
The returned error was plugin error as we weren't handling that case. This PR fixes it by checking for *oauth2.RetrieveError and based on status code from that error sets the error source. It also removes a logic to check for timeouts, as bumped grafana-plugin-sdk-go takes care of it. We have tests in place for this and they are passing even with removed logic, as sdk correctly handles it.
This PR takes care of false-positive plugin errors identified in https://ops.grafana-ops.net/goto/BHCltU6SR?orgId=1. The main issue is that if users input invalid Google JWT information - for example incorrect email:
The returned error was plugin error as we weren't handling that case. This PR fixes it by checking for
*oauth2.RetrieveError
and based on status code from that error sets the error source. It also removes a logic to check for timeouts, as bumpedgrafana-plugin-sdk-go
takes care of it. We have tests in place for this and they are passing even with removed logic, assdk
correctly handles it.Now this is fixed to downstream:
Also I had to fix some lint issues (see https://drone.grafana.net/grafana/google-sheets-datasource/447/1/8) - I have added a comments to them bellow.