Better feedback for incorrect Bible format

Bug #1698291 reported by Raoul Snyman
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Confirmed
Medium
Unassigned

Bug Description

We get a few of these every month in the support system. Someone who tries to import their Bible in who knows what format and just goes with the default format (which I am led to believe is OSIS). I know it's not our fault, but let's catch this exception and tell the user that they're using the wrong format.

 --- Exception Traceback ---
Traceback (most recent call last):
File "openlp\core\ui\wizard.py", line 216, in on_current_id_changed
File "openlp\plugins\bibles\forms\bibleimportform.py", line 632, in perform_wizard
File "openlp\plugins\bibles\lib\osis.py", line 65, in do_import
File "lxml.etree.pyx", line 2182, in lxml.etree._ElementTree.xpath (src\lxml\lxml.etree.c:59945)
File "lxml.etree.pyx", line 1778, in lxml.etree._ElementTree._assertHasRoot (src\lxml\lxml.etree.c:55819)
AssertionError: ElementTree not initialized, missing root

Changed in openlp:
status: New → Confirmed
importance: Undecided → Medium
tags: added: easy-fix
tags: added: beginner
Revision history for this message
David Wales (daviewales) wrote :

How clever does the fix need to be?

Would something like the following in bibleimportform.py, or osis.py be adequate?

`try:
     someFunctions()
 except AssertionError as err:
     displayErrorBox()`

Or are you looking for something a bit cleverer?

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

That's pretty much what we need to do. I'd need to dive into the code to make sure, but it shouldn't be much more complicated than that.

Revision history for this message
Tomas Groth (tomasgroth) wrote :

In our xml-based importers we should make the parser try to recover from errors. This also goes for our song importers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.