Improve error messaging

This commit is contained in:
ackwell 2024-01-09 01:15:08 +11:00
parent 36cbca4684
commit c3ba8a2231
3 changed files with 50 additions and 12 deletions

View file

@ -37,7 +37,12 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect
public Task<MdlFile?> ImportGltf(string inputPath)
{
var action = new ImportGltfAction(inputPath);
return Enqueue(action).ContinueWith(_ => action.Out);
return Enqueue(action).ContinueWith(task =>
{
if (task.IsFaulted && task.Exception != null)
throw task.Exception;
return action.Out;
});
}
/// <summary> Try to find the .sklb paths for a .mdl file. </summary>
/// <param name="mdlPath"> .mdl file to look up the skeletons for. </param>