Changeset 11043 in josm


Ignore:
Timestamp:
2016-09-23T20:27:32+02:00 (8 years ago)
Author:
Don-vip
Message:

see #13683 - display proper error message instead of throwing a RuntimeException

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r10632 r11043  
    292292            return layerDependencies;
    293293        }
     294
     295        @Override
     296        public String toString() {
     297            return "ImportSupport [layerName=" + layerName + ", layerIndex=" + layerIndex + ", layerDependencies="
     298                    + layerDependencies + ", inZipPath=" + inZipPath + ']';
     299        }
    294300    }
    295301
     
    489495                try {
    490496                    layer = imp.load(e, support, progressMonitor.createSubTaskMonitor(1, false));
    491                 } catch (IllegalDataException | IOException ex) {
     497                    if (layer == null) {
     498                        throw new IllegalStateException("Importer " + imp + " returned null for " + support);
     499                    }
     500                } catch (IllegalDataException | IllegalStateException | IOException ex) {
    492501                    exception = ex;
    493502                }
     
    511520                }
    512521
    513                 if (layer == null) throw new RuntimeException();
    514522                layersMap.put(idx, layer);
    515523            }
Note: See TracChangeset for help on using the changeset viewer.