use instanceof operator for detecting ExitStatus throw