[FIX] OWFile: Report errors for incorrect file formats instead of crashing#1635
Merged
ajdapretnar merged 1 commit intobiolab:masterfrom Oct 7, 2016
Merged
[FIX] OWFile: Report errors for incorrect file formats instead of crashing#1635ajdapretnar merged 1 commit intobiolab:masterfrom
ajdapretnar merged 1 commit intobiolab:masterfrom
Conversation
e8bcb34 to
a6c73ef
Compare
Current coverage is 88.66% (diff: 100%)@@ master #1635 diff @@
==========================================
Files 78 78
Lines 8124 8124
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 7203 7203
Misses 921 921
Partials 0 0
|
kernc
approved these changes
Oct 6, 2016
lanzagar
reviewed
Oct 7, 2016
Contributor
lanzagar
left a comment
There was a problem hiding this comment.
Has already been merged, so it is not possible to request changes in the review.
But can be fixed in a new PR.
| self.editor_model.set_domain(None) | ||
| self.reader = self._get_reader() | ||
| if not self.reader: | ||
| self.data = None |
Contributor
There was a problem hiding this comment.
self.data used to be cleared in case of errors, now it is not anymore...
This is used in reports for example (maybe elsewhere too), which now report on previous data, even after trying to open something else and failing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the file was in incorrect format, the exception was sometimes thrown already by
FileFormat.get_reader. To see this, rename an arbitrary file to .xlsx and try to load it.The code would be simpler with a single try-except. However, since it catches any exception, I prefer wrapping a single call, hence two separate try-except blocks.