please follow these steps.
1-get unread mail messages list from mail.
2-loop over mail message list.
3-put condition inside loop.
4- Condition Item.Subject.ToString.Contains(“Invoice”)
5- if the condition is true put all the process in your then block.
6- if mail not contains “Invoice” then put assign activity in else block and in assign activity put bool variable.
7- use bool variable outside if where you want to throw exception