Check exception messages in tests