Replace intentional exception with some code