mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +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
|
always sign in after registration
|
||||||
auto-sign-in
|
auto-sign-in
|
||||||
resources synchronization
|
resources synchronization
|
||||||
|
|
|
@ -212,12 +212,13 @@ public class ZLNetworkManager {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
final String[] eName = e.getClass().getName().split("\\.");
|
final String code;
|
||||||
if (eName.length > 0) {
|
if (e instanceof UnknownHostException) {
|
||||||
throw new ZLNetworkException(true, eName[eName.length - 1] + ": " + e.getMessage(), e);
|
code = ZLNetworkException.ERROR_RESOLVE_HOST;
|
||||||
} else {
|
} else {
|
||||||
throw new ZLNetworkException(true, e.getMessage(), e);
|
code = ZLNetworkException.ERROR_CONNECT_TO_HOST;
|
||||||
}
|
}
|
||||||
|
throw new ZLNetworkException(code, ZLNetworkUtil.hostFromUrl(request.URL), e);
|
||||||
} finally {
|
} finally {
|
||||||
request.doAfter(success);
|
request.doAfter(success);
|
||||||
if (httpClient != null) {
|
if (httpClient != null) {
|
||||||
|
@ -246,6 +247,7 @@ public class ZLNetworkManager {
|
||||||
try {
|
try {
|
||||||
perform(r);
|
perform(r);
|
||||||
} catch (ZLNetworkException e) {
|
} catch (ZLNetworkException e) {
|
||||||
|
e.printStackTrace();
|
||||||
errors.add(e.getMessage());
|
errors.add(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue