mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Add a stub for errors coming from Android
These errors are related to VPN connection errors
This commit is contained in:
@@ -15,8 +15,6 @@ import android.os.Messenger
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.MainThread
|
import androidx.annotation.MainThread
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import java.io.FileNotFoundException
|
|
||||||
import java.io.FileOutputStream
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.LazyThreadSafetyMode.NONE
|
import kotlin.LazyThreadSafetyMode.NONE
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
|
|||||||
+4
-1
@@ -70,7 +70,10 @@ enum ErrorCode
|
|||||||
CloakExecutableCrashed,
|
CloakExecutableCrashed,
|
||||||
|
|
||||||
// import and install errors
|
// import and install errors
|
||||||
ImportInvalidConfigError
|
ImportInvalidConfigError,
|
||||||
|
|
||||||
|
// Android errors
|
||||||
|
AndroidError
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace amnezia
|
} // namespace amnezia
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ QString errorString(ErrorCode code){
|
|||||||
|
|
||||||
case (ImportInvalidConfigError): return QObject::tr("The config does not contain any containers and credentials for connecting to the server");
|
case (ImportInvalidConfigError): return QObject::tr("The config does not contain any containers and credentials for connecting to the server");
|
||||||
|
|
||||||
|
// Android errors
|
||||||
|
case (AndroidError): return QObject::tr("VPN connection error");
|
||||||
|
|
||||||
case(InternalError):
|
case(InternalError):
|
||||||
default:
|
default:
|
||||||
return QObject::tr("Internal error");
|
return QObject::tr("Internal error");
|
||||||
|
|||||||
@@ -193,6 +193,10 @@ void VpnConnection::flushDns()
|
|||||||
|
|
||||||
ErrorCode VpnConnection::lastError() const
|
ErrorCode VpnConnection::lastError() const
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
return ErrorCode::AndroidError;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!m_vpnProtocol.data()) {
|
if (!m_vpnProtocol.data()) {
|
||||||
return ErrorCode::InternalError;
|
return ErrorCode::InternalError;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user