[MODIF] Improved exception catches in tests.