In the AvatarObjectLoader.cs there is a problem with the exception handling.
in private async void Load(string url) only CustomException are being cached. Because this is an async void function, other expections are lost
try
{
context = await executor.Execute(context);
}
catch (CustomException exception)
{
Failed(executor.IsCancelled ? FailureType.OperationCancelled : exception.FailureType, exception.Message);
return;
}
For example, in the editor, if trying to load two avatars with the same glb url at the same time, a native exception ¨Failed to create file¨ is thrown, but there is no way to catch it
The sdk code needs to be fixed to catch other exceptions:
try
{
context = await executor.Execute(context);
}
catch (CustomException exception)
{
Failed(executor.IsCancelled ? FailureType.OperationCancelled : exception.FailureType, exception.Message);
return;
}
catch (Excpetion exception) // Propagate unknown exceptions
{
Failed(FailureType.Unknown, exception.Message);
return;
}
This would allow the caller to handel other unknown exceptions. The current behaviour is that the LoadAvatarAsync never completes, if an unknown exception occurs