helper Error::bad_arg method
This commit is contained in:
parent
22b6d218bd
commit
70e2985cc4
|
@ -66,6 +66,13 @@ impl Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn bad_arg(func: Option<&str>, arg_index: i32, arg_name: Option<&str>, error: Arc<Self>) -> Self {
|
||||||
|
let func = func.map(|s| s.to_string());
|
||||||
|
let arg_name = arg_name.map(|s| s.to_string());
|
||||||
|
|
||||||
|
Self::BadArgument { func, arg_index, arg_name, error }
|
||||||
|
}
|
||||||
|
|
||||||
/// Throw the error in lua.
|
/// Throw the error in lua.
|
||||||
///
|
///
|
||||||
/// This method never returns
|
/// This method never returns
|
||||||
|
|
Loading…
Reference in New Issue