class ShellOutput {

    @Override
    public String toString () {
        StringBuilder stringBuilder = new StringBuilder();
        if (exitCode == 0) {
            stringBuilder.append(stdOut);
        } else {
            stringBuilder.append(exitCode).append(": ").append(Strings.isNotBlank(stdErr) ? stdErr : stdOut);
        }
        String output = stringBuilder.toString();
        if (output.length() > MAXIMUM_OUTPUT_LENGTH) {
            output = output.substring(0, MAXIMUM_OUTPUT_LENGTH - 3) + "...";
        }
        return output;
    }

    public  ShellOutput(int exitCode, String stdOut, String stdErr);
    public  ShellOutput(int exitCode, String stdOut);

}