done changes as per the comments made from the code review

Throw an appropriate exception to the upstream functionalities after logging.