Log exceptions in cache handling