Function artichoke::backtrace::format_cli_trace_into
source · pub fn format_cli_trace_into<W, E>(
error: W,
interp: &mut Artichoke,
exc: &E
) -> Result<(), Box<dyn Error>>
Expand description
Format an Exception
backtrace into an io::Write
suitable for
displaying in a Ruby CLI.
This backtrace has the same style and formatting as one returned from the
ruby
command in MRI.
§Examples
Executing the following Ruby code:
def fail; raise RuntimeError, "bang!"; end
fail
Results in this stack trace:
Traceback (most recent call last):
2: from -e:1
-e:1:in fail: bang! (RuntimeError)
§Errors
If writing into the provided out
writer fails, an error is returned.