lib/bolt_spec/plans/action_stubs.rb
# Set a default error result for all targets.
Set a default error result for all targets.
Set a default error result for all targets .
def error_with(data, clazz = Bolt::Error)
        data = Bolt::Util.walk_keys(data, &:to_s)
        if data['msg'] && data['kind'] && (data.keys - %w[msg kind details issue_code]).empty?
          @data[:default] = clazz.new(data['msg'], data['kind'], data['details'], data['issue_code'])
        else
          $stderr.puts "In the future 'error_with()' might require msg and kind, and " \
                      "optionally accept only details and issue_code."
          @data[:default] = data
        end
        @data_set = true
        self
      end
def error_with ( data , clazz = Bolt :: Error ) data = Bolt :: Util . walk_keys ( data , & :to_s ) if data [ 'msg' ] && data [ 'kind' ] && ( data . keys - %w[ msg kind details issue_code ] ) . empty? @data [ :default ] = clazz . new ( data [ 'msg' ] , data [ 'kind' ] , data [ 'details' ] , data [ 'issue_code' ] ) else $stderr . puts "In the future 'error_with()' might require msg and kind, and " "optionally accept only details and issue_code." @data [ :default ] = data end @data_set = true self end
Set a default error result for all targets.
Set a default error result for all targets .
data
<not_specific>
clazz
<not_specific>