lib/bolt/result.rb in bolt-0.5.1 vs lib/bolt/result.rb in bolt-0.6.0

- old
+ new

@@ -23,9 +23,31 @@ def success? true end end + class ErrorResult < Result + def initialize(message, issue_code, kind) + super(message) + @issue_code = issue_code + @kind = kind + end + + def to_h + { + 'error' => { + 'issue_code' => @issue_code, + 'kind' => @kind, + 'msg' => @message + } + } + end + + def success? + false + end + end + class CommandResult < Result attr_reader :stdout, :stderr, :exit_code def initialize(stdout, stderr, exit_code) @stdout = stdout