fix bug 1312023: add error handling for ambari server connection