Acutally, mocking exception is not consistent with rest of Symfony. I'd avoid this. See #10621