TracePoint's raise event should throw 'not supported by this event (RuntimeError)' on calling return_value
In TracePoint class, if a particular introspection method is not supported then 'not supported by this event (RuntimeError)' is thrown.
=== Line event doesn't support raised_exception
TracePoint.trace(:line) do |tp| p tp.raised_exception end #=> RuntimeError: 'raised_exception' not supported by this event
However, that doesn't seem to happen for 'raise' event. The call to return_value stops the trace altogether. Here's the code to reproduce it:
raise StandardError.new, 'Error!'
TracePoint.trace(:raise) do |tp|
p [tp.return_value, tp.raised_exception]
=== Expected Output
#=> `return_value': not supported by this event (RuntimeError)
=== Actual Output
Is this expected behaviour?