mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@grafana-runtime: Throw error if health check fails in DataSourceWithBackend (#29743)
This commit is contained in:
parent
f7ebb10dc5
commit
0cf283120b
@ -172,6 +172,7 @@ export class DataSourceWithBackend<
|
||||
|
||||
/**
|
||||
* Checks the plugin health
|
||||
* see public/app/features/datasources/state/actions.ts for what needs to be returned here
|
||||
*/
|
||||
async testDatasource(): Promise<any> {
|
||||
return this.callHealthCheck().then(res => {
|
||||
@ -181,10 +182,7 @@ export class DataSourceWithBackend<
|
||||
message: res.message,
|
||||
};
|
||||
}
|
||||
return {
|
||||
status: 'fail',
|
||||
message: res.message,
|
||||
};
|
||||
throw new Error(res.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user