Sha256: fc6918fa6d57230c6d3243e896a31ea0f8fd1cdb6930eb83fe1ef5ed079ec31e
Contents?: true
Size: 1.2 KB
Versions: 24
Compression:
Stored size: 1.2 KB
Contents
module DeepTest class MarshallableExceptionWrapper attr_reader :classname, :message, :backtrace def initialize(exception) @classname = exception.class.name @message = exception.message @backtrace = exception.backtrace end def ==(other) classname == other.classname && message == other.message && backtrace == other.backtrace end def resolve begin klass = eval("::" + classname) resolved_message = message rescue => e DeepTest.logger.debug("Unable to load exception class: #{classname}: #{e.message}") DeepTest.logger.debug(e.backtrace.join("\n")) klass = UnloadableException resolved_message = "#{classname}: #{message}" end begin resolved_exception = klass.new resolved_message rescue => e DeepTest.logger.debug("Unable to instantiation exception class: #{classname}: #{e.message}") DeepTest.logger.debug(e.backtrace.join("\n")) resolved_exception = UnloadableException.new resolved_message end resolved_exception.set_backtrace backtrace resolved_exception end end class UnloadableException < StandardError; end end
Version data entries
24 entries across 24 versions & 4 rubygems