Handle exceptions by type