|
@@ -150,6 +150,10 @@ type EventsRequestPartialProps = {
|
|
|
* This flag indicates whether or not this last bucket should be included in the result.
|
|
|
*/
|
|
|
partial: boolean;
|
|
|
+ /**
|
|
|
+ * Hide error toast (used for pages which also query eventsV2)
|
|
|
+ */
|
|
|
+ hideError?: boolean;
|
|
|
};
|
|
|
|
|
|
type TimeAggregationProps =
|
|
@@ -206,7 +210,7 @@ class EventsRequest extends React.PureComponent<EventsRequestProps, EventsReques
|
|
|
private unmounting: boolean = false;
|
|
|
|
|
|
fetchData = async () => {
|
|
|
- const {api, confirmedQuery, expired, name, ...props} = this.props;
|
|
|
+ const {api, confirmedQuery, expired, name, hideError, ...props} = this.props;
|
|
|
let timeseriesData: EventsStats | MultiSeriesEventsStats | null = null;
|
|
|
|
|
|
if (confirmedQuery === false) {
|
|
@@ -232,10 +236,12 @@ class EventsRequest extends React.PureComponent<EventsRequestProps, EventsReques
|
|
|
api.clear();
|
|
|
timeseriesData = await doEventsRequest(api, props);
|
|
|
} catch (resp) {
|
|
|
- if (resp && resp.responseJSON && resp.responseJSON.detail) {
|
|
|
- addErrorMessage(resp.responseJSON.detail);
|
|
|
- } else {
|
|
|
- addErrorMessage(t('Error loading chart data'));
|
|
|
+ if (!hideError) {
|
|
|
+ if (resp && resp.responseJSON && resp.responseJSON.detail) {
|
|
|
+ addErrorMessage(resp.responseJSON.detail);
|
|
|
+ } else {
|
|
|
+ addErrorMessage(t('Error loading chart data'));
|
|
|
+ }
|
|
|
}
|
|
|
this.setState({
|
|
|
errored: true,
|