mirror of
https://github.com/samsonjs/media.git
synced 2026-04-25 14:47:40 +00:00
seenCacheError should be set for all errors
PiperOrigin-RevId: 265662686
This commit is contained in:
parent
9ca5b0fc61
commit
aa6ead3d08
2 changed files with 7 additions and 4 deletions
|
|
@ -285,7 +285,7 @@ public final class CacheDataSource implements DataSource {
|
||||||
}
|
}
|
||||||
openNextSource(false);
|
openNextSource(false);
|
||||||
return bytesRemaining;
|
return bytesRemaining;
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
@ -327,6 +327,9 @@ public final class CacheDataSource implements DataSource {
|
||||||
}
|
}
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
handleBeforeThrow(e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -353,7 +356,7 @@ public final class CacheDataSource implements DataSource {
|
||||||
notifyBytesRead();
|
notifyBytesRead();
|
||||||
try {
|
try {
|
||||||
closeCurrentSource();
|
closeCurrentSource();
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
handleBeforeThrow(e);
|
handleBeforeThrow(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
@ -520,7 +523,7 @@ public final class CacheDataSource implements DataSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleBeforeThrow(IOException exception) {
|
private void handleBeforeThrow(Throwable exception) {
|
||||||
if (isReadingFromCache() || exception instanceof CacheException) {
|
if (isReadingFromCache() || exception instanceof CacheException) {
|
||||||
seenCacheError = true;
|
seenCacheError = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ public final class CacheUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ static boolean isCausedByPositionOutOfRange(IOException e) {
|
/* package */ static boolean isCausedByPositionOutOfRange(IOException e) {
|
||||||
Throwable cause = e;
|
Throwable cause = e;
|
||||||
while (cause != null) {
|
while (cause != null) {
|
||||||
if (cause instanceof DataSourceException) {
|
if (cause instanceof DataSourceException) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue