nealrichardson commented on code in PR #12839:
URL: https://github.com/apache/arrow/pull/12839#discussion_r846625210
##########
r/R/util.R:
##########
@@ -209,8 +209,7 @@ handle_csv_read_error <- function(e, schema) {
"row, you should supply the argument `skip = 1` to prevent the",
"header being read in as data."
)
- ))
+ ), call = call)
}
-
- abort(msg)
+ abort(conditionMessage(e), call = call)
Review Comment:
(Comments go for both functions)
We already have msg above so we can still use it.
We could also edit the `if` above to do `msg <- c(msg, i = ...)` and just
have one `abort()`, if you wanted to polish further.
```suggestion
abort(msg, call = call)
```
##########
r/R/csv.R:
##########
@@ -200,8 +200,8 @@ read_delim_arrow <- function(file,
tryCatch(
tab <- reader$Read(),
- error = function(e) {
- handle_csv_read_error(e, schema)
+ error = function(e, call = caller_env(n = 4)) {
Review Comment:
Is it always `n = 4`? Is there a more certain way to capture this? (Like, if
you define call_env outside of tryCatch, is it just *this* env?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]