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.
should we also emit here?