catch matching exceptions