Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » FileOutputStreamProvider - Error Written to Log
FileOutputStreamProvider - Error Written to Log [message #1692908] Mon, 20 April 2015 14:09 Go to next message
Arye Shemesh is currently offline Arye ShemeshFriend
Messages: 37
Registered: November 2012
Member
Hi Dirk,

First, thanks for the great work on this project.

When I try to export a table to a problematic location (e.g. a folder for which I don't have permissions to write to), the export aborts and an exception is logged. This behavior is in the FileOutputStreamProvider class, which swallows the exception and doesn't propagate it.

I'd like to change the behavior so the user will get a popup error dialog and no exception will be logged, as from the user point of view it is not understood what is going on.

I can, of course, override the default FileOutputStreamProvider with my own implementation, but i think the default behavior could be improved to just throw the original exception or to extract the exception handling to a separate overridable method.

What do you think?
Re: FileOutputStreamProvider - Error Written to Log [message #1692947 is a reply to message #1692908] Mon, 20 April 2015 18:45 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I'm against throwing the exception, since that would mean everybody would need to handle the exception, otherwise the NatTable instance breaks the application.
I also don't like the idea of introducing a method you need to override. That still means people need to create custom implementations.

But I can see the use case. IMHO it would be better to introduce some ErrorHandler interface you can register with the FileOutputStreamProvider. And there could be default implementations for simply logging or opening dialogs. We did something similar for editing with the IEditErrorHandler strategies. Such an approach would give users an easy way to customize error handling and it could be used at several places.

Feel free to create an enhancement ticket and contribute a solution via Gerrit.
Re: FileOutputStreamProvider - Error Written to Log [message #1742721 is a reply to message #1692947] Tue, 06 September 2016 21:24 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I provided a patch for this via https://bugs.eclipse.org/bugs/show_bug.cgi?id=471489

My tests succeed, but a verification would be nice.
Previous Topic:Nat table doesn't open the right file when I scroll bar and try with last objects
Next Topic:Adding a context menu in NatTable Eclipse 3 RCP Application
Goto Forum:
  


Current Time: Fri Feb 26 21:43:17 GMT 2021

Powered by FUDForum. Page generated in 0.01868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top