mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix: Remove the onRenderError prop and add an ErrorBoundary component
This commit is contained in:
@@ -9,7 +9,6 @@ export interface PanelProps<T = any> {
|
||||
renderCounter: number;
|
||||
width: number;
|
||||
height: number;
|
||||
onRenderError: () => void;
|
||||
}
|
||||
|
||||
export interface PanelOptionsProps<T = any> {
|
||||
|
||||
@@ -13,7 +13,6 @@ interface GraphProps {
|
||||
showBars?: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
onRenderError: () => void;
|
||||
}
|
||||
|
||||
export class Graph extends PureComponent<GraphProps> {
|
||||
@@ -38,7 +37,7 @@ export class Graph extends PureComponent<GraphProps> {
|
||||
return;
|
||||
}
|
||||
|
||||
const { width, timeSeries, timeRange, showLines, showBars, showPoints, onRenderError } = this.props;
|
||||
const { width, timeSeries, timeRange, showLines, showBars, showPoints } = this.props;
|
||||
|
||||
if (!width) {
|
||||
return;
|
||||
@@ -99,7 +98,7 @@ export class Graph extends PureComponent<GraphProps> {
|
||||
$.plot(this.element, timeSeries, flotOptions);
|
||||
} catch (err) {
|
||||
console.log('Graph rendering error', err, flotOptions, timeSeries);
|
||||
onRenderError();
|
||||
throw new Error('Error rendering panel');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user