Commit a813d67c authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

smb: map EHOSTUNREACH to ERR_CANNOT_CONNECT

Summary:
same as the ftp does. in fact, also steal the error message qtcpsocket
produces. effectively this makes smb://unavailableipaddress spit out
exactly the same error as ftp://unavailableipaddress

host unreachable being so vague, the pretty string continues to be vague
as well unfortunately.

BUG: 417166
FIXED-IN: 20.08.0

Test Plan: error upon accessing the unassigned address 192.168.1.99 is same between smb and ftp

Reviewers: ngraham

Reviewed By: ngraham

Subscribers: kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D27378
parent 233f30dc
......@@ -320,6 +320,11 @@ SMBSlave::SMBError SMBSlave::errnumToKioError(const SMBUrl &url, const int errNu
#endif
case ECONNABORTED:
return SMBError{ ERR_CONNECTION_BROKEN, url.host() };
case EHOSTUNREACH:
return SMBError{ ERR_CANNOT_CONNECT,
i18nc("@info:status smb failed to reach the server (e.g. server offline or network failure). %1 is an ip address or hostname",
"%1: Host unreachable",
url.host()) };
case 0: // success
return SMBError{ ERR_INTERNAL, i18n("libsmbclient reported an error, but did not specify "
"what the problem is. This might indicate a severe problem "
......
Markdown is supported
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