[epiphany/mcatanzaro/migrator-errors] profile-migrator: Improve error messages when profile migration fails
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/migrator-errors] profile-migrator: Improve error messages when profile migration fails
- Date: Fri, 15 Mar 2019 16:16:39 +0000 (UTC)
commit 9af6f66a990bc6b7663394a73fe83b7c389872b6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri Mar 15 11:13:58 2019 -0500
profile-migrator: Improve error messages when profile migration fails
src/profile-migrator/ephy-profile-migrator.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index aecafc0be..ece69055d 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -1069,16 +1069,20 @@ move_directory_contents (GFile *source,
if (!info)
break;
- g_autoptr(GFile) source_f = g_file_get_child (source, g_file_info_get_name (info));
- g_autoptr(GFile) dest_f = g_file_get_child (dest, g_file_info_get_name (info));
- if (!g_file_move (source_f, dest_f, G_FILE_COPY_NONE, NULL, NULL, NULL, &error)) {
- g_warning ("Failed to move %s: %s", g_file_info_get_name (info), error->message);
+ g_autoptr(GFile) source_file = g_file_get_child (source, g_file_info_get_name (info));
+ g_autoptr(GFile) dest_file = g_file_get_child (dest, g_file_info_get_name (info));
+ if (!g_file_move (source_file, dest_file, G_FILE_COPY_NONE, NULL, NULL, NULL, &error)) {
+ g_autofree char *source_path = g_file_get_path (source_file);
+ g_autofree char *dest_path = g_file_get_path (dest_file);
+ g_warning ("Failed to move %s to %s: %s", source_path, dest_path, error->message);
return FALSE;
}
}
- if (!g_file_delete (source, NULL, &error))
- g_warning ("Failed to delete left-over source: %s", error->message);
+ if (!g_file_delete (source, NULL, &error)) {
+ g_autofree char *source_path = g_file_get_path (source);
+ g_warning ("Failed to delete leftover source directory %s: %s", source_path, error->message);
+ }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]