diff --git a/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java b/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java index 8c7df993a..61ef7bb4d 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/basic1000/SystemPropertyCommand.java @@ -44,6 +44,7 @@ public class SystemPropertyCommand extends AnnotatedCommand { @Override public void process(CommandProcess process) { + int status = 0; try { if (StringUtils.isBlank(propertyName) && StringUtils.isBlank(propertyValue)) { // show all system properties @@ -52,7 +53,7 @@ public class SystemPropertyCommand extends AnnotatedCommand { // view the specified system property String value = System.getProperty(propertyName); if (value == null) { - process.write("In order to change the system properties, you must specify the property value.\n"); + process.write("There is no property with the key " + propertyName + ".\n"); } else { process.write(propertyName + "=" + value + "\n"); } @@ -64,8 +65,9 @@ public class SystemPropertyCommand extends AnnotatedCommand { } } catch (Throwable t) { process.write("Error during setting system property: " + t.getMessage() + "\n"); + status = 1; } finally { - process.end(); + process.end(status); } }