OpenAssetIO / usdOpenAssetIOResolver

An AR2 plugin that hosts OpenAssetIO
Apache License 2.0
24 stars 3 forks source link

Log errors during construction #42

Open feltech opened 2 weeks ago

feltech commented 2 weeks ago

What

Log any errors during construction of the Ar2 plugin

Why

Currently we allow exceptions to propagate if they occur in the constructor of the plugin.

However, since plugins are/can be instantiated deep inside USD lazily when the registry is first accessed (i.e. SdrRegistry::GetInstance()), if an application isn't aware that plugins are loading and can throw exceptions, then any error might just be swallowed and lead to hard-to-debug issues.

This came about whilst prototyping our Ar2 shim plugin in Katana, triggering a misleading error loading Katana's USD RenderInfo plugin, caused, ultimately, by a Python exception in BAL(!).

feltech commented 1 week ago

We should log at debug level, so that it isn't printed byu default, since the host application should be the one reporting these errors.