Modify

Opened 7 years ago

Closed 7 years ago

#16806 closed enhancement (fixed)

Display a more meaningful error message when saving files

Reported by: naoliv Owned by: team
Priority: normal Milestone: 18.10
Component: Core Version:
Keywords: Cc:

Description

If we try to save a file somewhere where we don't have permission, for example, we see this:

https://i.imgur.com/RpWHvkb.png

But it doesn't explain the cause nor the exact error (an access denied, for this case):

2018-10-05 14:35:02.919 SEVERE: java.nio.file.AccessDeniedException: /foo.osm
java.nio.file.AccessDeniedException: /foo.osm
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:215)
	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
	at java.base/java.nio.file.Files.newOutputStream(Files.java:218)
	at org.openstreetmap.josm.io.Compression.getCompressedFileOutputStream(Compression.java:219)
	at org.openstreetmap.josm.gui.io.importexport.OsmExporter.getOutputStream(OsmExporter.java:80)
	at org.openstreetmap.josm.gui.io.importexport.OsmExporter.doSave(OsmExporter.java:129)
	at org.openstreetmap.josm.gui.io.importexport.OsmExporter.save(OsmExporter.java:93)
	at org.openstreetmap.josm.gui.io.importexport.OsmExporter.exportData(OsmExporter.java:76)
	at org.openstreetmap.josm.gui.io.importexport.OsmExporter.exportData(OsmExporter.java:60)
	at org.openstreetmap.josm.actions.SaveActionBase.doInternalSave(SaveActionBase.java:101)
	at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:73)
	at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:60)
	at org.openstreetmap.josm.actions.SaveActionBase.actionPerformed(SaveActionBase.java:50)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:980)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1024)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6589)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6354)
	at java.desktop/java.awt.Container.processEvent(Container.java:2261)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4914)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4543)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4484)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2305)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

It would be good to have a more meaningful error message in the dialog, if possible.

JOSM:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-10-04 19:06:23 +0200 (Thu, 04 Oct 2018)
Revision:14295
Build-Date:2018-10-05 01:33:48
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14295 en) Linux Debian GNU/Linux testing (buster)
Memory Usage: 879 MB / 6144 MB (494 MB allocated, but free)
Java version: 10.0.2+13-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-10-jre:amd64-10.0.2+13-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21
VM arguments: [-Dawt.useSystemAAFontSettings=gasp]
Program arguments: [--language=en]

Change History (2)

comment:1 by Don-vip, 7 years ago

Milestone: 18.10

comment:2 by Don-vip, 7 years ago

Resolution: fixed
Status: newclosed

In 14296/josm:

fix #16806 - include class name in error message

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.