Used by a cache to report a problem with an original cause that may have occurred in the past as part of a separate operation.
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
For some caching strategies, it is advantageous to cache both the successfully fulfilled requests and the requests that failed due to an exception. The original exception is stored by the cache and rethrown when subsequent requests are made for the same object. Reusing the original exception object has some disadvantages: for example, the StackTrace property will be overwritten, the caller may attempt to handle the same problem twice, and there is no way to track the context where the original error occurred.
The class solves these problems by encapsulating the shared object as its InnerException property, and tracking additional details such as the timestamp and correlation ID for the original HTTP request.
For example, if the taxonomy navigation system encounters an error when it is trying to read a TermSet object into the taxonomy navigation cache, subsequent attempts to fetch the object will throw CachedException instances instead of reattempting the operation.