Made error handling more robust in method that checks server status (db connectivity)