cache: fix transform that throw errors from breaking sources

I'm not sure this is the right way to solve it.  Some comments inline in the code.
I'm not really sure how to write a test in the cache unit tests for this, but there is a pretty simple use case in the memory source tests.  Are you okay with that @dgeb?