Bug 53553 - No appropriate error message when trying to open a zero-length file
Summary: No appropriate error message when trying to open a zero-length file
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.6.0.4 release
Hardware: All Linux (All)
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks:
 
Reported: 2012-08-15 19:30 UTC by Tristan Miller
Modified: 2015-12-16 22:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2012-08-15 19:30:34 UTC
If you try to open a zero-length file with an unrecognized filename extension from the command line, LibreOffice outputs a rather unhelpful error message:

$ touch somefile

$ libreoffice somefile
terminate called after throwing an instance of 'libcdr::EndOfStreamException'

Trying to open such a zero-length file from the GUI results in no error message at all; the user is returned to the file selection dialog without any explanation of what is wrong.
Comment 1 Joel Madero 2013-06-10 16:01:39 UTC
What would you think would be a good message to send? 

I get this error with 4.2 master:

Version Incompatibility
Incorrect file version.
Comment 2 Tristan Miller 2013-06-10 16:29:10 UTC
Anything which indicates that the reason for failure was because the file was zero-length, or more generally because the file format was not valid, would be better than the behaviour I encountered, or the misleading error message you got.  Ideas:

"Cannot open file: file is zero-length"
"Cannot open file: invalid format"
Comment 3 Joel Madero 2013-06-10 16:32:00 UTC
Sure - I think that this is an enhancement request and not a bug report - nothing is really broken, just a slightly clearer message.


Enhancement
Low - seems like a very very unlikely situation and more likely than not just a user error but a clearer message couldn't hurt

ProposedEasyHack - probably easy to implement
Comment 4 Maxim Monastirsky 2014-02-26 21:45:27 UTC
With recent builds of 4.2/master, zero length files are opened in Writer. So I'm closing this bug as WORKSFORME. One problem that was in that scenario is that libreoffice wrote garbage to the file. I fixed it yesterday with http://cgit.freedesktop.org/libreoffice/core/commit/?id=27c3b8bca22353dfdcf4c248539a727522fc4e76.
Comment 5 Robinson Tryon (qubit) 2015-12-16 22:31:17 UTC
Migrating Whiteboard tags to Keywords: (ProposedEasyHack -> needsDevEval)
[NinjaEdit]