Add error message support for reader, Resolve #788

This commit is contained in:
tarsin committed 2023-02-14 12:33:33 +08:00
1 parent 8dcf5a3654
commit a6f1e91747
7 files changed
+15 -9

No files matched your search

@@ -293,7 +293,7 @@ public class ArchivePageLoader extends PageLoader2 {
// Check index valid
if (index < 0 || index >= size) {
notifyPageFailed(index);
notifyPageFailed(index, null);
continue;
}
@@ -343,7 +343,7 @@ public class ArchivePageLoader extends PageLoader2 {
if (image != null) {
notifyPageSucceed(index, image);
} else {
notifyPageFailed(index);
notifyPageFailed(index, null);
}
}
}
@@ -127,8 +127,8 @@ public class EhPageLoader extends PageLoader2 implements SpiderQueen.OnSpiderLis
Object object = mSpiderQueen.request(index);
if (object instanceof Float) {
notifyPagePercent(index, (Float) object);
} else if (object instanceof String) {
notifyPageFailed(index);
} else if (object instanceof String error) {
notifyPageFailed(index, error);
} else if (object == null) {
notifyPageWait(index);
}
@@ -141,8 +141,8 @@ public class EhPageLoader extends PageLoader2 implements SpiderQueen.OnSpiderLis
Object object = mSpiderQueen.forceRequest(index);
if (object instanceof Float) {
notifyPagePercent(index, (Float) object);
} else if (object instanceof String) {
notifyPageFailed(index);
} else if (object instanceof String error) {
notifyPageFailed(index, error);
} else if (object == null) {
notifyPageWait(index);
}
@@ -191,7 +191,7 @@ public class EhPageLoader extends PageLoader2 implements SpiderQueen.OnSpiderLis
@Override
public void onPageFailure(int index, String error, int finished, int downloaded, int total) {
notifyPageFailed(index);
notifyPageFailed(index, error);
}
@Override
@@ -205,7 +205,7 @@ public class EhPageLoader extends PageLoader2 implements SpiderQueen.OnSpiderLis
@Override
public void onGetImageFailure(int index, String error) {
notifyPageFailed(index);
notifyPageFailed(index, error);
}
@Override