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

This commit is contained in:
Andrej Ocenas 2020-12-11 16:40:46 +01:00 committed by GitHub
parent f7ebb10dc5
commit 0cf283120b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<
message: res.message, message: res.message,
}; };
} }
return { throw new Error(res.message);
status: 'fail',
message: res.message,
};
}); });
} }
} }