After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673521 - Uncaught exception when opening a document fails
Uncaught exception when opening a document fails
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
0.4.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-04-04 17:20 UTC by Cosimo Cecchi
Modified: 2012-04-16 14:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds exception handling to show_uri() when opening documents (796 bytes, patch)
2012-04-06 14:01 UTC, Feroze Naina
committed Details | Review

Description Cosimo Cecchi 2012-04-04 17:20:04 UTC
When the "Open" action is activated on a document from the selection mode toolbar, or by the right click context menu in a preview, we call the open() method on a Document JS object, which in turn calls Gtk.show_uri() [1].

Since Gtk.show_uri() can fail, it should use a try/catch and not letting exceptions go uncaught if opening fails for any reason. We could also show a dialog, or error box, when that happens but for now at least catching the exception and printing an error line on the terminal will do.

[1] http://git.gnome.org/browse/gnome-documents/tree/src/documents.js#n587
Comment 1 Feroze Naina 2012-04-06 14:01:44 UTC
Created attachment 211474 [details] [review]
Adds exception handling to show_uri() when opening documents
Comment 2 Cosimo Cecchi 2012-04-09 15:01:22 UTC
Review of attachment 211474 [details] [review]:

Thanks Feroze, your patch looks good except for a minor coding style nit.

::: src/documents.js
@@ +587,2 @@
     open: function(screen, timestamp) {
+        try{

Coding style: missing space before the opening brace
Comment 3 Cosimo Cecchi 2012-04-16 14:28:27 UTC
I wanted to get this patch in today's 0.4.1 release, so I tweaked the coding style as in my review and pushed it to git master and gnome-3-4 branches. Thanks!