Index: trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java	(revision 18657)
+++ trunk/src/org/openstreetmap/josm/io/OsmJsonReader.java	(revision 18658)
@@ -4,6 +4,6 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.IOException;
 import java.io.InputStream;
+import java.net.SocketException;
 import java.util.Collection;
 import java.util.Map.Entry;
@@ -18,4 +18,5 @@
 import javax.json.stream.JsonParser;
 import javax.json.stream.JsonParser.Event;
+import javax.json.stream.JsonParsingException;
 
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -186,13 +187,13 @@
                 parse();
             });
+        } catch (JsonParsingException exception) {
+            throw new IllegalDataException(exception);
         } catch (JsonException exception) {
-            if (exception.getCause() instanceof IOException) {
-                IllegalDataException ide = new IllegalDataException(exception.getCause());
-                // PMD 7 should be able to figure out that this is not an issue. See https://github.com/pmd/pmd/issues/2134 .
-                ide.addSuppressed(exception);
-                throw ide; // NOPMD
-            } else {
-                throw exception;
-            }
+            if (exception.getCause() instanceof SocketException) {
+                SocketException soe = (SocketException) exception.getCause();
+                soe.addSuppressed(exception); // Add the caught exception as a suppressed exception
+                throw new IllegalDataException(soe); // NOPMD -- PreserveStackTrace should be fixed with PMD 7
+            }
+            throw exception;
         }
     }
