Skip to content
Snippets Groups Projects
Commit 978c28a2 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

log: Error log exception, do not swallow it

parent 81bad0c0
No related branches found
No related tags found
1 merge request!191Add map module and Open-Meteo support
...@@ -53,6 +53,8 @@ import no.nibio.vips.util.ParseRESTParamUtil; ...@@ -53,6 +53,8 @@ import no.nibio.vips.util.ParseRESTParamUtil;
import no.nibio.vips.util.WeatherUtil; import no.nibio.vips.util.WeatherUtil;
import no.nibio.vips.util.XDate; import no.nibio.vips.util.XDate;
import no.nibio.vips.util.weather.WeatherDataSourceUtil; import no.nibio.vips.util.weather.WeatherDataSourceUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* This is a collection of (one) service(s) for models run from forms (not as part of batch) * This is a collection of (one) service(s) for models run from forms (not as part of batch)
...@@ -62,7 +64,9 @@ import no.nibio.vips.util.weather.WeatherDataSourceUtil; ...@@ -62,7 +64,9 @@ import no.nibio.vips.util.weather.WeatherDataSourceUtil;
@Path("rest/modelform") @Path("rest/modelform")
@Facet("restricted") @Facet("restricted")
public class ModelFormService { public class ModelFormService {
private static final Logger LOGGER = LoggerFactory.getLogger(ModelFormService.class);
@EJB @EJB
UserBean userBean; UserBean userBean;
@EJB @EJB
...@@ -196,14 +200,15 @@ public class ModelFormService { ...@@ -196,14 +200,15 @@ public class ModelFormService {
Integer VIPSCoreUserId = organization.getDefaultVipsCoreUserId(); Integer VIPSCoreUserId = organization.getDefaultVipsCoreUserId();
List<Result>results = forecastBean.runForecast(mConf, VIPSCoreUserId); List<Result> results = forecastBean.runForecast(mConf, VIPSCoreUserId);
return Response.ok().entity(results).build(); return Response.ok().entity(results).build();
} }
catch(PreprocessorException |RunModelException ex) catch(PreprocessorException |RunModelException ex)
{ {
LOGGER.error("Exception occurred when attempting to run the septoria humidity model", ex);
return Response.serverError().entity(ex.getMessage()).build(); return Response.serverError().entity(ex.getMessage()).build();
} }
} }
private ForecastModelConfiguration getForecastModelConfiguration(String modelId, String key, String value) private ForecastModelConfiguration getForecastModelConfiguration(String modelId, String key, String value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment