1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #3633

iphydf (1):
      chore: Improve diagnostics when toxcore failed to initialise.
This commit is contained in:
sudden6 2016-08-24 08:40:36 +02:00
commit b4da76862a
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -174,6 +174,9 @@ void Core::makeTox(QByteArray savedata)
{
case TOX_ERR_NEW_OK:
break;
case TOX_ERR_NEW_LOAD_BAD_FORMAT:
qWarning() << "failed to parse Tox save data";
break;
case TOX_ERR_NEW_PORT_ALLOC:
if (enableIPv6)
{
@ -191,7 +194,8 @@ void Core::makeTox(QByteArray savedata)
return;
case TOX_ERR_NEW_PROXY_BAD_HOST:
case TOX_ERR_NEW_PROXY_BAD_PORT:
qCritical() << "bad proxy";
case TOX_ERR_NEW_PROXY_BAD_TYPE:
qCritical() << "bad proxy, error code:" << tox_err;
emit badProxy();
return;
case TOX_ERR_NEW_PROXY_NOT_FOUND:
@ -199,14 +203,19 @@ void Core::makeTox(QByteArray savedata)
emit badProxy();
return;
case TOX_ERR_NEW_LOAD_ENCRYPTED:
qCritical() << "load data is encrypted";
qCritical() << "attempted to load encrypted Tox save data";
emit failedToStart();
return;
case TOX_ERR_NEW_MALLOC:
qCritical() << "memory allocation failed";
emit failedToStart();
return;
case TOX_ERR_NEW_NULL:
qCritical() << "a parameter was null";
emit failedToStart();
return;
case TOX_ERR_NEW_LOAD_BAD_FORMAT:
qWarning() << "bad load data format";
break;
default:
qCritical() << "Tox core failed to start";
qCritical() << "Tox core failed to start, unknown error code:" << tox_err;
emit failedToStart();
return;
}