Missing include

...and only use getCaughtException as first statement in catch block.

Change-Id: Idcac073896b84fd2671b52b2315f454651dbf910