jdk/src/jdk.attach/linux/classes/sun/tools/attach/VirtualMachineImpl.java
changeset 45004 ea3137042a61
parent 40943 46cd6d4f353f
equal deleted inserted replaced
44789:73fd39e0702e 45004:ea3137042a61
   209             }
   209             }
   210 
   210 
   211             // Special-case the "load" command so that the right exception is
   211             // Special-case the "load" command so that the right exception is
   212             // thrown.
   212             // thrown.
   213             if (cmd.equals("load")) {
   213             if (cmd.equals("load")) {
   214                 throw new AgentLoadException("Failed to load agent library");
   214                 String msg = "Failed to load agent library";
       
   215                 if (!message.isEmpty())
       
   216                     msg += ": " + message;
       
   217                 throw new AgentLoadException(msg);
   215             } else {
   218             } else {
   216                 if (message == null) {
   219                 if (message.isEmpty())
   217                     throw new AttachOperationFailedException("Command failed in target VM");
   220                     message = "Command failed in target VM";
   218                 } else {
   221                 throw new AttachOperationFailedException(message);
   219                     throw new AttachOperationFailedException(message);
       
   220                 }
       
   221             }
   222             }
   222         }
   223         }
   223 
   224 
   224         // Return the input stream so that the command output can be read
   225         // Return the input stream so that the command output can be read
   225         return sis;
   226         return sis;