thisisnic commented on code in PR #14030:
URL: https://github.com/apache/arrow/pull/14030#discussion_r961512745


##########
r/R/util.R:
##########
@@ -251,3 +238,19 @@ handle_augmented_field_misuse <- function(e, call) {
 is_compressed <- function(compression) {
   !identical(compression, "uncompressed")
 }
+
+# handler function which checks for a number of different read errors
+augment_io_error_msg <- function(e, call, ...){
+  dots <- list2(...)
+  msg <- conditionMessage(e)
+
+  if (!is.null(dots[["schema"]])) {
+    handle_csv_read_error(msg, call, dots[["schema"]])
+  }
+  if (!is.null(dots[["format"]])) {
+    handle_parquet_io_error(msg, call, dots[["format"]])
+  }
+
+  handle_augmented_field_misuse(msg, call)
+  abort(msg, call = call)
+}

Review Comment:
   Not sure if this approach of calling functions conditionally based on which 
optional arguments are supplied is reasonable or a bit of an anti-pattern.



-- 
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]

Reply via email to