Skip to content
Snippets Groups Projects
Commit d152240d authored by Antoine Fontaine's avatar Antoine Fontaine :8ball:
Browse files

Handles error more gracefully

parent 28425680
Branches
Tags
1 merge request!11Added folder support
......@@ -105,9 +105,10 @@ request_url (MoodleProviderState *state,
g_autoptr (GFile) file = g_file_new_for_uri (filename);
GInputStream *is;
is = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
if (!G_IS_INPUT_STREAM (is))
g_error ("Could not read file %s from cache\n", filename);
stream_cb (is, FALSE, filename, final_cb, user_data);
if (G_IS_INPUT_STREAM (is))
stream_cb (is, FALSE, filename, final_cb, user_data);
else
g_warning ("Could not read file %s from cache\n", filename);
}
}
......@@ -122,8 +123,6 @@ moodle_downloaded_file_cb (GInputStream *is,
{
if (should_save_to_disk)
write_g_input_stream_to_file (is, filename);
else
g_warning ("Could not download file; attempting to open from cache\n");
final_cb (user_data, g_strdup (filename));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment