Commit 0cf28312 by Andrej Ocenas Committed by GitHub

@grafana-runtime: Throw error if health check fails in DataSourceWithBackend (#29743)

parent f7ebb10d
...@@ -172,6 +172,7 @@ export class DataSourceWithBackend< ...@@ -172,6 +172,7 @@ export class DataSourceWithBackend<
/** /**
* Checks the plugin health * Checks the plugin health
* see public/app/features/datasources/state/actions.ts for what needs to be returned here
*/ */
async testDatasource(): Promise<any> { async testDatasource(): Promise<any> {
return this.callHealthCheck().then(res => { return this.callHealthCheck().then(res => {
...@@ -181,10 +182,7 @@ export class DataSourceWithBackend< ...@@ -181,10 +182,7 @@ export class DataSourceWithBackend<
message: res.message, message: res.message,
}; };
} }
return { throw new Error(res.message);
status: 'fail',
message: res.message,
};
}); });
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment