code: void readStatusResponse() throws SshException, PublicKeySubsystemException {
  
  		ByteArrayReader msg = new ByteArrayReader(nextMessage());
  
  		try {
  
  			msg.readString();
  			int status = (int) msg.readInt();
  			String desc = msg.readString();
  
  			if (status != PublicKeySubsystemException.SUCCESS) {
  				throw new PublicKeySubsystemException(status, desc);
  			}
  		} catch (IOException ex) {
  			throw new SshException(ex);
  		} finally {
  			try {
  				msg.close();
  			} catch (IOException e) {
  			}
  		}
  	}
docs: Read a status response and throw an exception if an error has occurred.
  
  @throws SshException
  @throws PublicKeyStatusException