Handle ERROR event as a CLOSE one and use masks not case to test events.