From 451f0b59760bf616710093a51415fb852ffa4309 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Tue, 8 Dec 2020 14:14:08 -0700 Subject: [PATCH] FIXUP: Fix JOSM-20203 Just notify the user that there is a problem. Don't cause an exception. Signed-off-by: Taylor Smock --- .../josm/plugins/mapwithai/backend/MapWithAIDataUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java index 592caa4..5b2579d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAIDataUtils.java @@ -37,7 +37,6 @@ import org.openstreetmap.josm.io.OsmTransferException; import org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin; import org.openstreetmap.josm.plugins.mapwithai.commands.MapWithAIAddCommand; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAILayerInfo; -import org.openstreetmap.josm.tools.JosmRuntimeException; import org.openstreetmap.josm.tools.Logging; import org.openstreetmap.josm.tools.Utils; @@ -167,7 +166,10 @@ public final class MapWithAIDataUtils { notification.setContent(tr("MapWithAI servers may be down.")); GuiHelper.runInEDT(notification::show); } else { - throw new JosmRuntimeException(e); + Logging.error(e); + Notification notification = new Notification(); + notification.setContent(e.getLocalizedMessage()); + GuiHelper.runInEDT(notification::show); } } }));