Merge lp:~ted/url-dispatcher/recoverable-inserts into lp:url-dispatcher/14.10

Proposed by Ted Gould
Status: Superseded
Proposed branch: lp:~ted/url-dispatcher/recoverable-inserts
Merge into: lp:url-dispatcher/14.10
Prerequisite: lp:~ted/url-dispatcher/ubuntu-app-launch
Diff against target: 107 lines (+39/-6)
4 files modified
service/dispatcher.c (+1/-1)
service/recoverable-problem.c (+1/-1)
service/recoverable-problem.h (+1/-1)
service/update-directory.c (+36/-3)
To merge this branch: bzr merge lp:~ted/url-dispatcher/recoverable-inserts
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Indicator Applet Developers Pending
Review via email: mp+221121@code.launchpad.net

Commit message

Recoverable errors on DB errors on update

Description of the change

Add some recoverable errors

To post a comment you must log in.
54. By Ted Gould

Add error for unable to set the notification time as well

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
55. By Ted Gould

Update to trunk

56. By Ted Gould

Const our strings

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'service/dispatcher.c'
2--- service/dispatcher.c 2014-05-27 17:07:09 +0000
3+++ service/dispatcher.c 2014-05-27 17:07:09 +0000
4@@ -72,7 +72,7 @@
5 g_variant_unref(pid_tuple);
6
7 gchar * signature = g_strdup_printf("url-dispatcher;bad-url;%s", badurl);
8- gchar * additional[3] = {
9+ const gchar * additional[3] = {
10 "BadURL",
11 badurl,
12 NULL
13
14=== modified file 'service/recoverable-problem.c'
15--- service/recoverable-problem.c 2013-09-19 17:01:34 +0000
16+++ service/recoverable-problem.c 2014-05-27 17:07:09 +0000
17@@ -61,7 +61,7 @@
18
19 /* Code to report an error */
20 void
21-report_recoverable_problem (const gchar * signature, GPid report_pid, gboolean wait, gchar * additional_properties[])
22+report_recoverable_problem (const gchar * signature, GPid report_pid, gboolean wait, const gchar * additional_properties[])
23 {
24 GError * error = NULL;
25 gint error_stdin = 0;
26
27=== modified file 'service/recoverable-problem.h'
28--- service/recoverable-problem.h 2013-09-16 20:56:28 +0000
29+++ service/recoverable-problem.h 2014-05-27 17:07:09 +0000
30@@ -22,5 +22,5 @@
31 void report_recoverable_problem (const gchar * signature,
32 GPid report_pid,
33 gboolean wait,
34- gchar * additional_properties[]);
35+ const gchar * additional_properties[]);
36
37
38=== modified file 'service/update-directory.c'
39--- service/update-directory.c 2014-03-14 19:47:07 +0000
40+++ service/update-directory.c 2014-05-27 17:07:09 +0000
41@@ -55,7 +55,22 @@
42 return;
43 }
44
45- url_db_insert_url(urldata->db, urldata->filename, protocol, suffix);
46+ if (!url_db_insert_url(urldata->db, urldata->filename, protocol, suffix)) {
47+ const gchar * additional[7] = {
48+ "Filename",
49+ NULL,
50+ "Protocol",
51+ NULL,
52+ "Suffix",
53+ NULL,
54+ NULL
55+ };
56+ additional[1] = urldata->filename;
57+ additional[3] = protocol;
58+ additional[5] = suffix;
59+
60+ report_recoverable_problem("url-dispatcher-update-sqlite-insert-error", 0, TRUE, additional);
61+ }
62 }
63
64 static void
65@@ -115,7 +130,17 @@
66 }
67 }
68
69- url_db_set_file_motification_time(db, filename, &filetime);
70+ if (!url_db_set_file_motification_time(db, filename, &filetime)) {
71+ const gchar * additional[7] = {
72+ "Filename",
73+ NULL,
74+ NULL
75+ };
76+ additional[1] = filename;
77+
78+ report_recoverable_problem("url-dispatcher-update-sqlite-fileupdate-error", 0, TRUE, additional);
79+ return FALSE;
80+ }
81
82 return TRUE;
83 }
84@@ -128,6 +153,14 @@
85 g_debug(" Removing file: %s", filename);
86 if (!url_db_remove_file((sqlite3*)user_data, filename)) {
87 g_warning("Unable to remove file: %s", filename);
88+ const gchar * additional[3] = {
89+ "Filename",
90+ NULL,
91+ NULL
92+ };
93+ additional[1] = filename;
94+
95+ report_recoverable_problem("url-dispatcher-update-remove-file-error", 0, TRUE, additional);
96 }
97 }
98
99@@ -198,7 +231,7 @@
100
101 int close_status = sqlite3_close(db);
102 if (close_status != SQLITE_OK) {
103- gchar * additional[3] = {
104+ const gchar * additional[3] = {
105 "SQLiteStatus",
106 NULL,
107 NULL

Subscribers

People subscribed via source and target branches