Improving the general-purpose exception catching