GNOME Bugzilla – Bug 764049
Better error message for connection refused
Last modified: 2016-10-04 11:04:47 UTC
nautilus when connecting to a computer on which I forgot to enable SSH, I get: Don't have permission to access the requested location The error from ssh is a better one: ssh: connect to host classic.local port 22: Connection refused which tells me I forgot to enable the service, rather than thinking it forgot to ask me about a password.
Sftp backend fails with "Connection refused by server", this is feature of Nautilus. However the backend returns G_IO_ERROR_PERMISSION_DENIED, but it should use G_IO_ERROR_CONNECTION_REFUSED instead. Consequently Nautilus will show "Unhandled error message: Connection refused by server"... So, let's fix the error code in this bug report. Maybe another bug report should be filed for Nautilus, because it would be good to include the original error message in their error messages probably...
Created attachment 324571 [details] [review] sftp: Fix error code if ssh is not properly configured G_IO_ERROR_PERMISSION_DENIED is returned if ssh is not properly configured. Nautilus shows "Don't have permission to access the requested location" in such case rather than "Connection refused by server", which is confusing. G_IO_ERROR_CONNECTION_REFUSED should be returned instead.
Attachment 324571 [details] pushed as 88f9166 - sftp: Fix error code if ssh is not properly configured