Display error codes when the connection is terminated

This commit is contained in:
Cameron Gutman
2023-12-22 14:12:59 -06:00
parent 2cef09471b
commit 9ed8252cc6
2 changed files with 6 additions and 2 deletions

View File

@@ -132,7 +132,11 @@ void Session::clConnectionTerminated(int errorCode)
default:
s_ActiveSession->m_UnexpectedTermination = true;
emit s_ActiveSession->displayLaunchError(tr("Connection terminated"));
// We'll assume large errors are hex values
bool hexError = qAbs(errorCode) > 1000;
emit s_ActiveSession->displayLaunchError(tr("Connection terminated") + "\n\n" +
tr("Error code: %1").arg(errorCode, hexError ? 8 : 0, hexError ? 16 : 10, QChar('0')));
break;
}