mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Transforms: Catch errors while running transforms (#73451)
This commit is contained in:
parent
ca64d919ad
commit
e605c686f8
@ -1,6 +1,6 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { Observable, of, ReplaySubject, Unsubscribable } from 'rxjs';
|
||||
import { map, mergeMap } from 'rxjs/operators';
|
||||
import { map, mergeMap, catchError } from 'rxjs/operators';
|
||||
|
||||
import {
|
||||
ApplyFieldOverrideOptions,
|
||||
@ -221,7 +221,17 @@ export class PanelQueryRunner {
|
||||
interpolate: (v: string) => getTemplateSrv().replace(v, data?.request?.scopedVars),
|
||||
};
|
||||
|
||||
return transformDataFrame(transformations, data.series, ctx).pipe(map((series) => ({ ...data, series })));
|
||||
return transformDataFrame(transformations, data.series, ctx).pipe(
|
||||
map((series) => ({ ...data, series })),
|
||||
catchError((err) => {
|
||||
console.warn('Error running transformation:', err);
|
||||
return of({
|
||||
...data,
|
||||
state: LoadingState.Error,
|
||||
error: toDataQueryError(err),
|
||||
});
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
async run(options: QueryRunnerOptions) {
|
||||
|
Loading…
Reference in New Issue
Block a user