def err(message, code: nil)
      @state[:result] = false
      @state[:errors].push(
        message: message,
        code: code
      )

      # raise error if command needs exceptions
      raise message if @options[:exceptions]
    end
def err(message, code: nil)
      @state[:result] = false
      @state[:errors].push(
        message: message,
        code: code
      )

      # raise error if command needs exceptions
      raise message if @options[:exceptions]
    end
This function can be used to stop the command execution and
 add a new error.
 Using err inside a callback should not stop the execution but
 should avoid the call of the next callback.
 Every time you call this function, a new error should be added
 to the errors list.
 If the exceptions option is active, it should raise a new error.

 ==== Attributes

 * +message+ - The message string of the error.
 * +code+ - The error code.