Skip to content

Commit 3c834ac

Browse files
committed
ui: always show visible localized error messages
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 8669ae7 commit 3c834ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ object ErrorMessages {
9292
rootCause is ChecksumException -> {
9393
resources.getString(R.string.error_qr_checksum)
9494
}
95-
rootCause.message != null -> {
96-
rootCause.message!!
95+
rootCause.localizedMessage != null -> {
96+
rootCause.localizedMessage!!
9797
}
9898
else -> {
9999
val errorType = rootCause.javaClass.simpleName
@@ -109,7 +109,7 @@ object ErrorMessages {
109109
if (kfe!!.type == KeyFormatException.Type.LENGTH) return resources.getString(KFE_FORMAT_MAP.getValue(kfe.format))
110110
} else if (bce.cause is ParseException) {
111111
val pe = bce.cause as ParseException?
112-
if (pe!!.message != null) return ": ${pe.message}"
112+
if (pe!!.localizedMessage != null) return ": ${pe.localizedMessage}"
113113
} else if (bce.location == BadConfigException.Location.LISTEN_PORT) {
114114
return resources.getString(R.string.bad_config_explanation_udp_port)
115115
} else if (bce.location == BadConfigException.Location.MTU) {

0 commit comments

Comments
 (0)