mirror of
https://github.com/collinsmith/riiablo.git
synced 2024-12-22 21:24:20 +07:00
Added error logging for AssetManager AssetLoader#loadAsync errors
This commit is contained in:
parent
f811a85141
commit
e212201fc6
@ -171,10 +171,15 @@ public final class AssetManager implements Disposable {
|
||||
loader
|
||||
.ioAsync(promise, executor, AssetManager.this, asset, handle, adapter)
|
||||
.addListener((FutureListener) future -> {
|
||||
@SuppressWarnings("unchecked") // guaranteed by loader contract
|
||||
T object = (T) loader.loadAsync(promise, AssetManager.this, asset, handle, future.getNow());
|
||||
boolean inserted = syncQueue.offer(SyncMessage.wrap(container, promise, loader, object));
|
||||
if (!inserted) log.error("Failed to enqueue {}", asset);
|
||||
try {
|
||||
@SuppressWarnings("unchecked") // guaranteed by loader contract
|
||||
T object = (T) loader.loadAsync(promise, AssetManager.this, asset, handle, future.getNow());
|
||||
boolean inserted = syncQueue.offer(SyncMessage.wrap(container, promise, loader, object));
|
||||
if (!inserted) log.error("Failed to enqueue {}", asset);
|
||||
} catch (Throwable t) {
|
||||
log.error("Failed to load {}", asset, t);
|
||||
ExceptionUtils.rethrow(t);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user