I’m currently working on exception handling for Addressables related parts of code in our project, so I wanted to be sure that I can provide the most precise feedback to the player when something wrong happens. Although there are some exceptions scattered across the docs, I wanted to list them here in one place and also list some of the cases that I can’t find any info about what exception gets throwen when they occur.
-
ResourceManager exceptions which are exceptions related to the AsyncOperation and they usually occur during development phase or can be result of oversight during build process or asset management on cloud. I would call this group of exceptions more severe and action in response to them shoud probably be to instruct player to contact the support since they will probably brake the game and generate ANR.
-
InvalidKeyException which occur whenever there is non-existent key in any kind of request for addressable asset. These exceptions can be either “ignored” (i.e. setting placeholder image instead of requested one) or treated as ResourceManager exceptions.
-
Device out of memory cases and the rest of IO exceptions whose structure I’m not aware of and is the reason why I started this thread. I tried to find them under UnityWebRequest, since this is what addressables use for remote groups, but with no luck.
Let me know if I missed something or am wrong about what I suggested, I would like us to generate a useful list of exceptions and best practices on how to handle them.