Implemented the try catch test case.