Avoid throwing non-descriptive errors
In some places the JavaScript does not check types or values of the variables before passing them to Rust. This results in uninformative errors like Failed to convert napi value Object into rust type
. This happens for example when passing a string where an int should be in a batch statement.