Search Unity

Feedback Exceptions thrown when label is not found

Discussion in 'Addressables' started by Jaimi, Jan 21, 2020.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    When I pass a label to load assets, and that label is not found, a couple of exceptions are thrown. Since these exceptions are thrown inside the addressables code, I can't catch them.

    My suggestion is to simply abort the process, and call the completed function with a "Not Found" status. This would allow us to handle this better in several ways:

    We could look for new content, and download it.
    We could simply ignore it if it were optional DLC for example.

    The exceptions thrown when the label does not exist are as follows:

    Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[System.Collections.Generic.IList`1[UnityEngine.Object]], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=System.String[]
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:<.ctor>b__27_0(AsyncOperationHandle)
    DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.AddressableAssets.Initialization.<>c__DisplayClass13_0:<LoadContentCatalogInternal>b__0(AsyncOperationHandle`1)
    DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted(AsyncOperationHandle`1)
    DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19)


    And

    Exception encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result='', status='Succeeded' - Chain<IList`1>: ChainOperation of Type: System.Collections.Generic.IList`1[UnityEngine.Object] failed because dependent operation failed
    Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=System.String[]
    UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1:OnWrappedCompleted(AsyncOperationHandle`1)
    DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19)
     
  2. Shaunyowns

    Shaunyowns

    Joined:
    Nov 4, 2019
    Posts:
    328
    Hey again @Jaimi, I'll send this over!
     
    Jaimi likes this.