We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fee0bb0 commit ad135e9Copy full SHA for ad135e9
lib/minitest/test.rb
@@ -198,7 +198,17 @@ def capture_exceptions # :nodoc:
198
rescue Assertion => e
199
self.failures << e
200
rescue Exception => e
201
- self.failures << UnexpectedError.new(e)
+ self.failures << UnexpectedError.new(sanitize_exception e)
202
+ end
203
+
204
+ def sanitize_exception e # :nodoc:
205
+ Marshal.dump e
206
+ e
207
+ rescue TypeError
208
+ bt = e.backtrace
209
+ e = RuntimeError.new "Wrapped undumpable exception for: #{e.class}: #{e.message}"
210
+ e.set_backtrace bt
211
212
end
213
214
def with_info_handler &block # :nodoc:
0 commit comments