grafana/public
Piotr Jamróz 9ace8686a1
Datasources: Improve error handling for testing data sources (#35120)
* Improve error handling for error messages

The error message will be read from error object from the following properties in the following order:
- message
- data.message
- statusText

* Convert api/ds/query errors to TestingStatus

SQL datasources (mysql, mssql, postgres) and CloudWatch use api/ds/query to test the data source, but previously didn't handle errors returned by this endpoint. If the error cannot be handled it's re-thrown to be handled in public/app/features/datasources/state/actions.ts

* Use async/await instead of Promises

* Remove incorrect type import

TestingStatus is in app/types. Should be pulled down to grafana/data but it depends on HealthCheckResultDetails that is public and lives in grafana/runtime. Ideally TestingStatus should live in grafana/data but I'm not sure if HealthCheckResultDetails can be move there too (?)

* Update packages/grafana-data/src/types/datasource.ts

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>

* Handle errors with no details in toTestingStatus instead of re-throwing

* Update packages/grafana-data/src/types/datasource.ts

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-08 14:32:27 +02:00
..
app Datasources: Improve error handling for testing data sources (#35120) 2021-07-08 14:32:27 +02:00
dashboards Prettier: Upgrade to 2 (#30387) 2021-01-20 07:59:48 +01:00
emails Alerting: update email template (#34205) 2021-05-19 18:58:31 +02:00
fonts Security: Update default CSP template and fix firefox CSP issues (#34836) 2021-05-28 17:01:10 +02:00
img Add custom icons for layout options (#34890) 2021-05-31 10:38:39 +03:00
lib AzureMonitor: Kusto language support (#33528) 2021-05-11 16:48:59 +02:00
sass DashboardPage: Refactor state to fix state timing bugs and reduce unnecessary re-renders (#36460) 2021-07-07 18:39:45 +02:00
test GraphNG: uPlot 1.6.13 (#35844) 2021-06-17 13:20:27 -05:00
testdata Histogram: Adds histogram test dashboard & test data (#34821) 2021-05-27 17:27:29 +02:00
vendor Decimals: Big Improvements to auto decimals and fixes to auto decimals bug found in 7.4-beta1 (#30519) 2021-01-22 16:37:56 +01:00
views Allow white labeling loading logo (#36174) 2021-07-02 14:17:10 +02:00
robots.txt add support for robots.txt file 2015-06-15 19:02:38 -04:00