Weird segfault when inspecting value type is back.

Working around with a crude rescue block.
This commit is contained in:
Michael Miller 2022-03-25 23:54:44 -06:00
parent 28ae03d56f
commit bbaa8816b8
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2

View file

@ -292,7 +292,12 @@ module Spectator
nil
{% else %}
# The stubbed value was something else entirely and cannot be cast to the return type.
raise TypeCastError.new("#{_spectator_stubbed_name} received message #{ {{call}} } and is attempting to return a `#{%value.class}`, but returned type must be `#{ {{type}} }`.")
%type = begin
%value.class.to_s
rescue
"<Unknown>"
end
raise TypeCastError.new("#{_spectator_stubbed_name} received message #{ {{call}} } and is attempting to return a `#{%type}`, but returned type must be `#{ {{type}} }`.")
{% end %}
end
end