Catch exceptions from match test