Skip to content

Commit ca8e488

Browse files
committed
Need to be prepared for exceptions in #print_variable
E.g. such exception may occur for mock objects
1 parent 4ef04c4 commit ca8e488

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.4.31](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.30...v0.4.31)
2+
3+
* need to handle mock objects somehow
4+
[RUBY-16665](https://youtrack.jetbrains.com/issue/RUBY-16665)
5+
16
## [0.4.30](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.29...v0.4.30)
27

38
* reverting fix for

lib/ruby-debug-ide/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debugger
2-
IDE_VERSION='0.4.30'
2+
IDE_VERSION='0.4.31'
33
end

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def print_variable(name, value, kind)
178178
has_children, value.respond_to?(:object_id) ? value.object_id : value.id)
179179
print("<value><![CDATA[%s]]></value>", escaped_value_str) if Debugger.rm_protocol_extensions
180180
print('</variable>')
181+
rescue StandardError => e
182+
print_debug "Unexpected exception \"%s\"\n%s", e.to_s, e.backtrace.join("\n")
183+
print("<variable name=\"%s\" kind=\"%s\" value=\"%s\"/>",
184+
CGI.escapeHTML(name), kind, CGI.escapeHTML(value.to_s))
181185
end
182186

183187
def print_breakpoints(breakpoints)

0 commit comments

Comments
 (0)