You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/09 12:25:54 UTC

[GitHub] [arrow] nealrichardson commented on a diff in pull request #12839: ARROW-16154: [R] Errors which pass through `handle_csv_read_error()` and `handle_parquet_io_error()` need better error tracing

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org