mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Be more robust against load callback failures
Issue: #2795 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174836960
This commit is contained in:
parent
f014b67d3e
commit
7f135f2cda
1 changed files with 10 additions and 1 deletions
|
|
@ -380,7 +380,13 @@ public final class Loader implements LoaderErrorThrower {
|
|||
callback.onLoadCanceled(loadable, nowMs, durationMs, false);
|
||||
break;
|
||||
case MSG_END_OF_SOURCE:
|
||||
callback.onLoadCompleted(loadable, nowMs, durationMs);
|
||||
try {
|
||||
callback.onLoadCompleted(loadable, nowMs, durationMs);
|
||||
} catch (RuntimeException e) {
|
||||
// This should never happen, but handle it anyway.
|
||||
Log.e(TAG, "Unexpected exception handling load completed", e);
|
||||
fatalError = new UnexpectedLoaderException(e);
|
||||
}
|
||||
break;
|
||||
case MSG_IO_EXCEPTION:
|
||||
currentError = (IOException) msg.obj;
|
||||
|
|
@ -392,6 +398,9 @@ public final class Loader implements LoaderErrorThrower {
|
|||
start(getRetryDelayMillis());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Never happens.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue