Prevent error from being thrown on rollupMetric

I have a dashboard page where users can specify multiple filters on a couple of datasources. 2 of these data sources are rollupMetrics calls. When a combination of filters is applied such that no objects match the filter, the api call throws a 500 error resulting in the page looking to be broken.

Is there a way to force a rollupMetrics call to return all 0’s instead of throwing an error when this happens? I have tried continueOnError: true but that did not help

Currently the continueOnError flag gets respected specifically while evaluating the metrics. Since the fetching of the sources happens before, the continueOnError flag doesn’t get respected.
The simplest would be to add a try catch around the call and generate a null series with

Timeseries.makeNorm(NormTimeseriesDoubleSpec.make({start:YOUR_START, end:YOUR_END,interval:YOUR_INTERVAL}))
1 Like