seenCacheError should be set for all errors

PiperOrigin-RevId: 265662686
This commit is contained in:
olly 2019-08-27 13:28:07 +01:00 committed by Oliver Woodman
parent c3d6be3afd
commit ad699b8ff6
2 changed files with 7 additions and 4 deletions

View File

@ -283,7 +283,7 @@ public final class CacheDataSource implements DataSource {
}
openNextSource(false);
return bytesRemaining;
} catch (IOException e) {
} catch (Throwable e) {
handleBeforeThrow(e);
throw e;
}
@ -325,6 +325,9 @@ public final class CacheDataSource implements DataSource {
}
handleBeforeThrow(e);
throw e;
} catch (Throwable e) {
handleBeforeThrow(e);
throw e;
}
}
@ -349,7 +352,7 @@ public final class CacheDataSource implements DataSource {
notifyBytesRead();
try {
closeCurrentSource();
} catch (IOException e) {
} catch (Throwable e) {
handleBeforeThrow(e);
throw e;
}
@ -516,7 +519,7 @@ public final class CacheDataSource implements DataSource {
}
}
private void handleBeforeThrow(IOException exception) {
private void handleBeforeThrow(Throwable exception) {
if (isReadingFromCache() || exception instanceof CacheException) {
seenCacheError = true;
}

View File

@ -359,7 +359,7 @@ public final class CacheUtil {
}
}
/*package*/ static boolean isCausedByPositionOutOfRange(IOException e) {
/* package */ static boolean isCausedByPositionOutOfRange(IOException e) {
Throwable cause = e;
while (cause != null) {
if (cause instanceof DataSourceException) {