7: def trap_rbox_errors(ret=nil, &command)
8: begin
9: ret = command.call if command
10: return unless ret.is_a?(Rye::Rap)
11: li ' ' << ret.stdout.join("#{$/} ") if !ret.stdout.empty?
12: print_response(ret)
13: rescue IOError => ex
14: le " Connection Error (#{ex.message})".color(:red)
15: choice = Annoy.get_user_input('(S)kip (R)etry (F)orce (A)bort: ', nil, 3600) || ''
16: if choice.match(/\AS/i)
17: return
18: elsif choice.match(/\AR/i)
19: retry
20: elsif choice.match(/\AF/i)
21: @@global.force = true
22: retry
23: else
24: exit 12
25: end
26: end
27:
28: ret
29: end