Fix incorrect exception messages in CacheManager::factory