mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
gio: Include filename in error message
I'm tired of seeing 'No such file or directory' in the logs without a hint as to what is actually wrong. Including the filename here may help me tracking down a bug in the continuous infrastructure.
This commit is contained in:
parent
d20e88fd11
commit
42699e37be
@ -232,11 +232,15 @@ _g_local_file_enumerator_new (GLocalFile *file,
|
||||
dir = opendir (filename);
|
||||
if (dir == NULL)
|
||||
{
|
||||
gchar *utf8_filename;
|
||||
errsv = errno;
|
||||
|
||||
g_set_error_literal (error, G_IO_ERROR,
|
||||
g_io_error_from_errno (errsv),
|
||||
g_strerror (errsv));
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
g_io_error_from_errno (errsv),
|
||||
"Error opening directory '%s': %s",
|
||||
utf8_filename, g_strerror (errsv));
|
||||
g_free (utf8_filename);
|
||||
g_free (filename);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user