Added code for test app. Catching an exception.