Closed eitsupi closed 4 months ago
I think I can do better. What error message do you expect?
I was thinking that it would be nice if the Rust side argument name was added in the error message.
That is, since I believe the following function is used here
pub fn compile(
prql_query: &str,
target: &str,
format: bool,
signature_comment: bool,
) -> savvy::Result<Sexp> {
Like:
#> Error: Unexpected type for the `prql_query` argument:
#> expected: character
#> actual: double
Not perfect, but should be better now. I hope https://github.com/yutannihilation/savvy/issues/251 will allow us to create nicer error messages on R's side.
> to_upper(1L)
Error: Argument `x` must be character, not integer
Awesome! Thanks for the quick update!
If we currently pass the wrong type of argument to a function created with savvy, we don't know which argument type was incorrect because it does not show up in the error message. It would be great if we could identify which function or argument is the cause.
Created on 2024-06-11 with reprex v2.1.0