equal
deleted
inserted
replaced
212 } |
212 } |
213 |
213 |
214 // Special-case the "load" command so that the right exception is |
214 // Special-case the "load" command so that the right exception is |
215 // thrown. |
215 // thrown. |
216 if (cmd.equals("load")) { |
216 if (cmd.equals("load")) { |
217 throw new AgentLoadException("Failed to load agent library"); |
217 String msg = "Failed to load agent library"; |
|
218 if (!message.isEmpty()) |
|
219 msg += ": " + message; |
|
220 throw new AgentLoadException(msg); |
218 } else { |
221 } else { |
219 if (message == null) { |
222 if (message.isEmpty()) |
220 throw new AttachOperationFailedException("Command failed in target VM"); |
223 message = "Command failed in target VM"; |
221 } else { |
224 throw new AttachOperationFailedException(message); |
222 throw new AttachOperationFailedException(message); |
|
223 } |
|
224 } |
225 } |
225 } |
226 } |
226 |
227 |
227 // Return the input stream so that the command output can be read |
228 // Return the input stream so that the command output can be read |
228 return sis; |
229 return sis; |