GNOME Bugzilla – Bug 740396
Remove uses of g_error in ephy-history-service and ephy-sqlite-connection
Last modified: 2014-12-10 14:11:58 UTC
Currently, whenever a database operation fails (in e.g. ephy-history-service.c, ephy-history-service-urls-table.c, and ephy-sqlite-connection.c, maybe other files too) we call g_error() to report a fatal error, crashing epiphany and triggering distro bug reporting tools. This is bad because there are all sort of non-fatal reasons why a database access could fail. For example, if you delete ~/.config/epiphany/ephy-history.db while epiphany is open, epiphany will crash. There are also several places in these files where there is code after a call to g_error() (usually g_error_free() and then a return with a failure status), which doesn't make sense because g_error() will never return.
+ Trace 234351
Thread 1 (Thread 0x7fb9a3df6700 (LWP 4071))
*** Bug 738308 has been marked as a duplicate of this bug. ***
Yes, it seems that's an overlook. I suppose for most cases we want to use g_warning() instead. I would probably double check, though, for which cases g_error() might still make sense. For database operations, probably not.
Created attachment 292405 [details] [review] Don't crash when a database access fails Database accesses can fail for many reasons, none of which merit a crash. In particular, this should fix https://bugzilla.redhat.com/show_bug.cgi?id=1065494
Review of attachment 292405 [details] [review]: Thanks!