show better error message, when no data points are found
This commit is contained in:
@@ -16,6 +16,7 @@ import org.lucares.pdbui.domain.PlotRequest;
|
||||
import org.lucares.pdbui.domain.PlotResponse;
|
||||
import org.lucares.performance.db.CollectionUtils;
|
||||
import org.lucares.recommind.logs.InternalPlottingException;
|
||||
import org.lucares.recommind.logs.NoDataPointsException;
|
||||
import org.lucares.recommind.logs.Plotter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -53,13 +54,17 @@ public class PdbController implements HardcodedValues, CollectionUtils {
|
||||
|
||||
final PlotSettings plotSettings = PlotSettingsTransformer.toSettings(request);
|
||||
|
||||
final File image = plotter.plot(plotSettings);
|
||||
try {
|
||||
final File image = plotter.plot(plotSettings);
|
||||
|
||||
final Path relativeImagePath = plotter.getOutputDir().relativize(image.toPath());
|
||||
final String relativeImgUrl = relativeImagePath.toString().replace('\\', '/');
|
||||
final String imageUrl = WEB_IMAGE_OUTPUT_PATH + "/" + relativeImgUrl;
|
||||
LOGGER.trace("image url: {}", imageUrl);
|
||||
return new PlotResponse(imageUrl);
|
||||
final Path relativeImagePath = plotter.getOutputDir().relativize(image.toPath());
|
||||
final String relativeImgUrl = relativeImagePath.toString().replace('\\', '/');
|
||||
final String imageUrl = WEB_IMAGE_OUTPUT_PATH + "/" + relativeImgUrl;
|
||||
LOGGER.trace("image url: {}", imageUrl);
|
||||
return new PlotResponse(imageUrl);
|
||||
} catch (final NoDataPointsException e) {
|
||||
throw new NotFoundException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/autocomplete", //
|
||||
|
||||
Reference in New Issue
Block a user