Issue with using the ResourceManager.ExceptionHandler for Addressables

The issue is that it doesn’t work at all.

I have, in my MonoBehaviour-derived class, the following fragments of code:

public void Start()
    {
        ResourceManager.ExceptionHandler = CustomExceptionHandler;
    }

// some unrelated code

void CustomExceptionHandler(AsyncOperationHandle handle, Exception exception)
    {
        if (exception.GetType() != typeof(InvalidKeyException)) {
            Addressables.LogException(handle, exception);
        } else {
            MyLoggingClass.Log((exception as InvalidKeyException).Message);
        }
    }

I then use a call to Addressables.LoadAssetAsync<GameObject>($"{addressableAssetAddress}"); to load an asset. Specifically, in this call, there’s the potential that “addressableAssetAddress” isn’t the address of a real asset, which will cause it to throw an “UnityEngine.AddressableAssets.InvalidKeyException.” According to the documentation, me setting the ExceptionHandler to my custom handler should cause it to use that exception handler instead of just crashing out normally. However, that’s not what happens (at least in editor). I put breakpoints in the the CustomExceptionHandler, I run, the async method generates the InvalidKeyException, the game crashes, and the CustomExceptionHandler never so much as gets called. Am I doing things wrong, or is this just an issue with the addressables system?

A quick update: I found the issue. I was not manually calling InitializeAsync before setting the ExceptionHandler value. This meant that, the first time I called LoadAssetAsync, my ExceptionHandler value would be overwritten. I really wish they’d put that in the documentation for ResourceManager.ExceptionHandler.