[orca] Handle documentFrames which do not implement the document interface



commit 7957322e2539408157089f4d88f7ca5d035d63af
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Feb 19 07:08:52 2017 -0500

    Handle documentFrames which do not implement the document interface

 src/orca/scripts/web/script_utilities.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 05a613f..6ee0302 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -252,8 +252,16 @@ class Utilities(script_utilities.Utilities):
     def documentFrameURI(self, documentFrame=None):
         documentFrame = documentFrame or self.documentFrame()
         if documentFrame and not self.isZombie(documentFrame):
-            document = documentFrame.queryDocument()
-            return document.getAttributeValue('DocURL')
+            try:
+                document = documentFrame.queryDocument()
+            except NotImplementedError:
+                msg = "WEB: %s does not implement document interface" % documentFrame
+                debug.println(debug.LEVEL_INFO, msg, True)
+            except:
+                msg = "ERROR: Exception querying document interface of %s" % documentFrame
+                debug.println(debug.LEVEL_INFO, msg, True)
+            else:
+                return document.getAttributeValue('DocURL')
 
         return None
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]