https://bugs.kde.org/show_bug.cgi?id=367924

            Bug ID: 367924
           Summary: Confusing error message from kioslave for TCPSlaveBase
                    errors
           Product: frameworks-kio
           Version: unspecified
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: NOR
         Component: general
          Assignee: fa...@kde.org
          Reporter: luigi.tosc...@tiscali.it
                CC: kdelibs-b...@kde.org

Currently TCPSlaveBase::connectToHost contains:


        if (d->socket.state() != KTcpSocket::ConnectedState) {
            if (errorString) {
                *errorString = host + QLatin1String(": ") +
d->socket.errorString();
            }
            switch (d->socket.error()) {
            case KTcpSocket::UnsupportedSocketOperationError:
                return ERR_UNSUPPORTED_ACTION;
            case KTcpSocket::RemoteHostClosedError:
                return ERR_CONNECTION_BROKEN;
            case KTcpSocket::SocketTimeoutError:
                return ERR_SERVER_TIMEOUT;
            case KTcpSocket::HostNotFoundError:
                return ERR_UNKNOWN_HOST;
            default:
                return ERR_CANNOT_CONNECT;
            }
        }

This means that all the errors above will contain the hostname and an error
string.

On the other side, the main consumers seems to be  KIO::buildErrorString which
adds additional text, for example:

    case  KIO::ERR_UNKNOWN_HOST:
        result = errorText.isEmpty() ? i18n("No hostname specified.") :
i18n("Unknown host %1",  errorText);
        break;
    [...]
    case  KIO::ERR_CANNOT_CONNECT:
        result = i18n("Could not connect to host %1.",  errorText.isEmpty() ?
QStringLiteral("localhost") : errorText);
        break;
    case  KIO::ERR_CONNECTION_BROKEN:
        result = i18n("Connection to host %1 is broken.",  errorText);
        break;
    [...]
    case  KIO::ERR_SERVER_TIMEOUT:
        result = i18n("Timeout on server\n%1",  errorText);
        break;


Interesting enough, the case for ERR_SUPPORTED_ACTION returns directly the
errorText (since the conversion to SVN, 2002).

The question is: should the string returned by connectToHost be changed, or
should buildErrorString be fixed to account for the error message which
contains not only the hostname?

Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to