1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-08 22:21:08 +01:00

Use Exception.getString in HostAddress

instead of getMessage(), because some Exceptions, e.g. Android's
NetworkOnMainThreadException, will return null on
getMessage(). Exception.toString() does what we want, i.e. returns
- the exception class name
- and the return value of getLocalizedMessage()
This commit is contained in:
Florian Schmaus 2015-01-18 18:57:08 +01:00
parent 0bcd3d9356
commit 9ae66cc747
2 changed files with 3 additions and 7 deletions

View file

@ -109,13 +109,9 @@ public class HostAddress {
}
public String getErrorMessage() {
String error;
if (exception == null) {
error = "No error logged";
return "No error logged";
}
else {
error = exception.getMessage();
}
return toString() + " Exception: " + error;
return "'" + toString() + "' failed because " + exception.toString();
}
}