mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
better error message
This commit is contained in:
parent
80a135d85f
commit
bf781b2600
2 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,3 @@
|
|||
better error message (UnknownHostException)
|
||||
always sign in after registration
|
||||
auto-sign-in
|
||||
resources synchronization
|
||||
|
|
|
@ -212,12 +212,13 @@ public class ZLNetworkManager {
|
|||
throw e;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
final String[] eName = e.getClass().getName().split("\\.");
|
||||
if (eName.length > 0) {
|
||||
throw new ZLNetworkException(true, eName[eName.length - 1] + ": " + e.getMessage(), e);
|
||||
final String code;
|
||||
if (e instanceof UnknownHostException) {
|
||||
code = ZLNetworkException.ERROR_RESOLVE_HOST;
|
||||
} else {
|
||||
throw new ZLNetworkException(true, e.getMessage(), e);
|
||||
code = ZLNetworkException.ERROR_CONNECT_TO_HOST;
|
||||
}
|
||||
throw new ZLNetworkException(code, ZLNetworkUtil.hostFromUrl(request.URL), e);
|
||||
} finally {
|
||||
request.doAfter(success);
|
||||
if (httpClient != null) {
|
||||
|
@ -246,6 +247,7 @@ public class ZLNetworkManager {
|
|||
try {
|
||||
perform(r);
|
||||
} catch (ZLNetworkException e) {
|
||||
e.printStackTrace();
|
||||
errors.add(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue