Skip to main content

lindera_ruby/
error.rs

1//! Error types for Lindera operations.
2//!
3//! This module provides error types used throughout the Lindera Ruby bindings.
4
5use magnus::{Error, Ruby};
6
7/// Converts a Lindera error message into a Magnus Ruby error.
8///
9/// # Arguments
10///
11/// * `ruby` - Ruby runtime handle.
12/// * `msg` - Error message string.
13///
14/// # Returns
15///
16/// A Magnus `Error` wrapping a Ruby `RuntimeError`.
17pub fn to_magnus_error(ruby: &Ruby, msg: String) -> Error {
18    Error::new(ruby.exception_runtime_error(), msg)
19}