Index: trunk/src/org/openstreetmap/josm/io/FileImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6619)
+++ trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6621)
@@ -18,6 +18,8 @@
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
+import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 
 public abstract class FileImporter implements Comparable<FileImporter>, LayerChangeListener {
@@ -66,15 +68,40 @@
             importData(f, progressMonitor);
             return true;
+        } catch (IllegalDataException e) {
+            Throwable cause = e.getCause();
+            if (cause instanceof ImportCancelException) {
+                displayCancel(cause);
+            } else {
+                displayError(f, e);
+            }
+            return false;
         } catch (Exception e) {
-            e.printStackTrace();
-            HelpAwareOptionPane.showMessageDialogInEDT(
-                    Main.parent,
-                    tr("<html>Could not read file ''{0}''.<br>Error is:<br>{1}</html>", f.getName(), e.getMessage()),
-                    tr("Error"),
-                    JOptionPane.ERROR_MESSAGE, null
-            );
+            displayError(f, e);
             return false;
         }
     }
+    
+    private static void displayError(File f, Exception e) {
+        e.printStackTrace();
+        HelpAwareOptionPane.showMessageDialogInEDT(
+                Main.parent,
+                tr("<html>Could not read file ''{0}''.<br>Error is:<br>{1}</html>", f.getName(), e.getMessage()),
+                tr("Error"),
+                JOptionPane.ERROR_MESSAGE, null
+        );
+    }
+    
+    private static void displayCancel(final Throwable t) {
+        GuiHelper.runInEDTAndWait(new Runnable() {
+            @Override
+            public void run() {
+                Notification note = new Notification(t.getMessage());
+                note.setIcon(JOptionPane.INFORMATION_MESSAGE);
+                note.setDuration(Notification.TIME_SHORT);
+                note.show();
+            }
+        });
+    }
+    
     public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
         try {
Index: trunk/src/org/openstreetmap/josm/io/ImportCancelException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ImportCancelException.java	(revision 6621)
+++ trunk/src/org/openstreetmap/josm/io/ImportCancelException.java	(revision 6621)
@@ -0,0 +1,10 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+/**
+ * All exceptions resulting from a user cancelation during any import should implement this interface.
+ * @since 6621
+ */
+public interface ImportCancelException {
+
+}
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 6619)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 6621)
@@ -84,4 +84,8 @@
     }
 
+    protected void throwException(String msg, Throwable th) throws XMLStreamException {
+        throw new OsmParsingException(msg, parser.getLocation(), th);
+    }
+
     protected void throwException(String msg) throws XMLStreamException {
         throw new OsmParsingException(msg, parser.getLocation());
@@ -135,5 +139,5 @@
             if (cancel) {
                 cancel = false;
-                throwException(tr("Reading was canceled"));
+                throw new OsmParsingCanceledException(tr("Reading was canceled"), parser.getLocation());
             }
 
@@ -300,5 +304,5 @@
             id = Long.parseLong(value);
         } catch(NumberFormatException e) {
-            throwException(tr("Illegal value for attribute ''ref'' on member in relation {0}. Got {1}", Long.toString(r.getUniqueId()),value));
+            throwException(tr("Illegal value for attribute ''ref'' on member in relation {0}. Got {1}", Long.toString(r.getUniqueId()),value), e);
         }
         value = parser.getAttributeValue(null, "type");
@@ -309,5 +313,5 @@
             type = OsmPrimitiveType.fromApiTypeName(value);
         } catch(IllegalArgumentException e) {
-            throwException(tr("Illegal value for attribute ''type'' on member {0} in relation {1}. Got {2}.", Long.toString(id), Long.toString(r.getUniqueId()), value));
+            throwException(tr("Illegal value for attribute ''type'' on member {0} in relation {1}. Got {2}.", Long.toString(id), Long.toString(r.getUniqueId()), value), e);
         }
         value = parser.getAttributeValue(null, "role");
@@ -404,5 +408,5 @@
             return User.createOsmUser(id, name);
         } catch(NumberFormatException e) {
-            throwException(MessageFormat.format("Illegal value for attribute ''uid''. Got ''{0}''.", uid));
+            throwException(MessageFormat.format("Illegal value for attribute ''uid''. Got ''{0}''.", uid), e);
         }
         return null;
@@ -441,5 +445,5 @@
                 version = Integer.parseInt(versionString);
             } catch(NumberFormatException e) {
-                throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString));
+                throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString), e);
             }
             if (ds.getVersion().equals("0.6")){
@@ -502,5 +506,5 @@
                 } else {
                     // for an existing primitive this is a problem
-                    throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
+                    throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v), e);
                 }
             }
@@ -526,5 +530,5 @@
             return Long.parseLong(value);
         } catch(NumberFormatException e) {
-            throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.",name, value));
+            throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.",name, value), e);
         }
         return 0; // should not happen
@@ -532,11 +536,4 @@
 
     private static class OsmParsingException extends XMLStreamException {
-        public OsmParsingException() {
-            super();
-        }
-
-        public OsmParsingException(String msg) {
-            super(msg);
-        }
 
         public OsmParsingException(String msg, Location location) {
@@ -548,12 +545,4 @@
             super(msg, th);
             this.location = location;
-        }
-
-        public OsmParsingException(String msg, Throwable th) {
-            super(msg, th);
-        }
-
-        public OsmParsingException(Throwable th) {
-            super(th);
         }
 
@@ -568,4 +557,18 @@
             msg = msg + " " + tr("(at line {0}, column {1})", getLocation().getLineNumber(), getLocation().getColumnNumber());
             return msg;
+        }
+    }
+
+    /**
+     * Exception thrown after user cancelation.
+     */
+    private static final class OsmParsingCanceledException extends OsmParsingException implements ImportCancelException {
+        /**
+         * Constructs a new {@code OsmParsingCanceledException}.
+         * @param msg The error message
+         * @param location The parser location
+         */
+        public OsmParsingCanceledException(String msg, Location location) {
+            super(msg, location);
         }
     }
