FYI MESSAGES.needHostAndPort can just return OperationFailedException, reducing this and the other use to

throw MESSAGES.needHostAndPort();