UI Automation throws COMException
Documentation for UI Automation does not mention anything about COMException. However, I encountered the below exception:
System.Runtime.InteropServices.COMException
à System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
à MS.Internal.Automation.UiaCoreApi.CheckError(Int32)
à MS.Internal.Automation.UiaCoreApi.UiaGetUpdatedCache(MS.Internal.Automation.SafeNodeHandle, UiaCacheRequest, NormalizeState, System.Windows.Automation.Condition)
à System.Windows.Automation.AutomationElement.Normalize(System.Windows.Automation.Condition, System.Windows.Automation.CacheRequest)
à System.Windows.Automation.TreeWalker.Normalize(System.Windows.Automation.AutomationElement)
What are the possible reasons for such exceptions? The documentation for UI Automation does not mention anything about COMExceptions and so it not clear that whether these exception should be handled or not.