Refine ssh client code to return error code instead of exception Change-Id: I008a7878440fad07bac9696d2006f276e6d0f5f1