Code changes done for Login and exception handling

Code changes done for Login and exception handling