Skip to content

Commit

Permalink
Report metric label errors to user
Browse files Browse the repository at this point in the history
  • Loading branch information
meln5674 committed Nov 25, 2022
1 parent ef4a199 commit e01bfc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export class DataSource extends DataSourceWithBackend<MongoDBQuery, MongoDBDataS
return lastValueFrom(
this.query(dataQueryRequest)
).then((rsp) => {
if (rsp.error) {
throw new Error(rsp.error.message);
}
if (rsp.data?.length) {
return frameToMetricFindValue(rsp.data[0]);
}
Expand Down

0 comments on commit e01bfc7

Please sign in to comment.