Generate catch code to reduce clutter.