| | 77 | if defined?(Breakpoint) and @params["BP-RETRY"] then |
|---|
| | 78 | msg = exception.backtrace.first |
|---|
| | 79 | if md = /^(.+?):(\d+)(?::in `(.+)')?$/.match(msg) then |
|---|
| | 80 | origin_file, origin_line = md[1], md[2].to_i |
|---|
| | 81 | |
|---|
| | 82 | set_trace_func(lambda do |type, file, line, method, context, klass| |
|---|
| | 83 | if file == origin_file and line == origin_line then |
|---|
| | 84 | set_trace_func(nil) |
|---|
| | 85 | @params["BP-RETRY"] = false |
|---|
| | 86 | |
|---|
| | 87 | callstack = caller |
|---|
| | 88 | callstack.slice!(0) if callstack.first["rescue.rb"] |
|---|
| | 89 | file, line, method = *callstack.first.match(/^(.+?):(\d+)(?::in `(.*?)')?/).captures |
|---|
| | 90 | |
|---|
| | 91 | message = "Exception at #{file}:#{line}#{" in `#{method}'" if method}." |
|---|
| | 92 | |
|---|
| | 93 | Breakpoint.handle_breakpoint(context, message, file, line) |
|---|
| | 94 | end |
|---|
| | 95 | end) |
|---|
| | 96 | |
|---|
| | 97 | retry |
|---|
| | 98 | end |
|---|
| | 99 | end |
|---|
| | 100 | |
|---|