FIX: FakeExceptions should have the original class name
This commit is contained in:
parent
e58f67a0c0
commit
8a0be71b3c
|
@ -19,7 +19,15 @@ module TurboTests
|
||||||
def self.from_obj(obj)
|
def self.from_obj(obj)
|
||||||
if obj
|
if obj
|
||||||
obj = obj.symbolize_keys
|
obj = obj.symbolize_keys
|
||||||
new(
|
|
||||||
|
klass =
|
||||||
|
Class.new(FakeException) do
|
||||||
|
define_singleton_method(:name) do
|
||||||
|
obj[:class_name]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
klass.new(
|
||||||
obj[:backtrace],
|
obj[:backtrace],
|
||||||
obj[:message],
|
obj[:message],
|
||||||
FakeException.from_obj(obj[:cause])
|
FakeException.from_obj(obj[:cause])
|
||||||
|
|
|
@ -21,6 +21,7 @@ module TurboTests
|
||||||
def exception_to_json(exception)
|
def exception_to_json(exception)
|
||||||
if exception
|
if exception
|
||||||
{
|
{
|
||||||
|
class_name: exception.class.name.to_s,
|
||||||
backtrace: exception.backtrace,
|
backtrace: exception.backtrace,
|
||||||
message: exception.message,
|
message: exception.message,
|
||||||
cause: exception_to_json(exception.cause)
|
cause: exception_to_json(exception.cause)
|
||||||
|
|
Loading…
Reference in New Issue