Updated classes with exception handling

Exception handling in the classes of the package
product-greg/modules/integration/tests-integration/tests-search-version/src/test/java/org/wso2/carbon/registry/version/test