Hola , quisiera que el programa al tirar una excepción no corte la ejecución y siga.Como se haría eso teniendo un try y catch ?
Se sacaria la excepción ?
por ejemplo :
public ScrollResponse<Prediction> getSitePredictionsScroll(String site, Target target) throws ApiException{
try {
AndQueryBuilder builder = QueryBuilders.and(
QueryBuilders.eq("target", target.asKey()),
QueryBuilders.eq("route.site_id", site));
ScrollResponse<Prediction> scrollResponse = dsClient.scrollBuilder()
.withSize(1000)
.withQuery(builder)
.execute(Prediction.class);
return scrollResponse;
} catch (Exception e) {
DatadogFuryMetricCollector.INSTANCE.incrementCounter("shipping_delorean_get_site_predictions_scroll_ds");
logger.error(String.format("[metric:shipping_scroll_ds] - Exception getting all Deviations from DS - Error: %s - Trace: %s", e.getMessage(), org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e)));
throw new ApiException("internal_error", "Exception getting all Predictions from DS", e);
}
}
}