How to handle no internet case (RemoteProviderException) with Addressables?

If there is no internet and no cached version a “RemoteProviderException : Unable to load asset bundle” is thrown in console and the code never reaches the if block. What is the best way to avoid this? My current code is as follows:

_assetReference.LoadAssetAsync().Completed += op =>
{

Debug.Log(“Assets loaded”);
if (op.Status == AsyncOperationStatus.Failed)
{
Debug.Log(“Assets loading failed”);
}
else if (op.Status == AsyncOperationStatus.Succeeded)
{
Debug.Log(“Assets loading success”);
}
};

You can use try/catch.

@kkyriakos It’s a little confusing, but the exception message is logged as an error rather than being thrown. Under the failed status case, you can check if the op.OperationException.Message contains “RemoteProviderException : Unable to load asset bundle”

So basically you get an error even if you handle it correctly? If yes, can you please push this to the team to get it properly handled? At least, throw a regular exception that we can catch, like grown-ups do

Internally Addressables handles the exceptions, then they are logged as errors in the console. The idea behind this is to prevent interrupting execution.

It’s also possible to turn off the logs, by disabling the “Log Runtime Exceptions” setting8403078--1109604--upload_2022-8-30_15-49-36.png