GSocketClient: improve error messages on connection failure

Include the hostname (or proxy hostname if it was the connection to
the proxy server that failed) in the GError message when
g_socket_client_connect* fail.

https://bugzilla.gnome.org/show_bug.cgi?id=661266
This commit is contained in:
Dan Winship
2011-11-14 19:46:02 -05:00
parent 74dad004d1
commit bad6c0ad15
2 changed files with 52 additions and 10 deletions

View File

@@ -1682,7 +1682,6 @@ g_socket_connect (GSocket *socket,
if (g_socket_check_connect_result (socket, error))
break;
}
g_prefix_error (error, _("Error connecting: "));
}
else
{
@@ -1692,9 +1691,9 @@ g_socket_connect (GSocket *socket,
}
}
else
g_set_error (error, G_IO_ERROR,
socket_io_error_from_errno (errsv),
_("Error connecting: %s"), socket_strerror (errsv));
g_set_error_literal (error, G_IO_ERROR,
socket_io_error_from_errno (errsv),
socket_strerror (errsv));
return FALSE;
}