mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DataSourceSettings: use details from HealthCheckResult (#32759)
* add custom HealthCheckError * allow details from HealthCheckResult to be passed in the error * pass in details.message from testing status into Alert component * add chance * add aria label to read only message * update tests and add error message tests * extract HealthCheckResultDetails type out and add comment * extract TestingStatus interface out * remove chance from test * remove chance
This commit is contained in:
@@ -95,15 +95,10 @@ export const testDataSource = (
|
||||
|
||||
dispatch(testDataSourceSucceeded(result));
|
||||
} catch (err) {
|
||||
let message = '';
|
||||
const { statusText, message: errMessage, details } = err;
|
||||
const message = statusText ? 'HTTP error ' + statusText : errMessage;
|
||||
|
||||
if (err.statusText) {
|
||||
message = 'HTTP error ' + err.statusText;
|
||||
} else {
|
||||
message = err.message;
|
||||
}
|
||||
|
||||
dispatch(testDataSourceFailed({ message }));
|
||||
dispatch(testDataSourceFailed({ message, details }));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user