/// Convert the error a core call returned into the typed Ruby exception of its family. An error
/// of a type with no converter becomes a `RuntimeError` with the message.
#[allow(dead_code)]
fn alef_magnus_err<E: std::fmt::Display + 'static>(e: E) -> magnus::Error {
let message = e.to_string();
#[allow(unused_variables)]
let any: Box<dyn std::any::Any> = Box::new(e);
{% for arm in arms %} let any = match any.downcast::<{{ arm.rust_path }}>() {
Ok(typed) => return {{ arm.fn_name }}(*typed),
Err(any) => any,
};
{% endfor %} let _ = any;
magnus::Error::new(unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(), message)
}