ump45nose commented on code in PR #4939:
URL: https://github.com/apache/arrow-adbc/pull/4939#discussion_r4344248271


##########
r/adbcdrivermanager/R/error.R:
##########
@@ -75,6 +75,16 @@ stop_for_error <- function(status, error) {
     # Store the listified error information
     cnd$error <- error
 
+    # R truncates printed error messages to getOption("warning.length")
+    # characters (1000 by default), which cuts off long driver manager
+    # messages such as the list of paths searched for a driver manifest.
+    # Raise the limit to its maximum while the error is signalled so the
+    # full message is shown; the option is restored when stop() unwinds.
+    if (nchar(msg, type = "bytes") > getOption("warning.length", 1000L)) {
+      old_options <- options(warning.length = 8170L)
+      on.exit(options(old_options), add = TRUE)
+    }
+

Review Comment:
   Good catch, thanks. The limit covers the whole printed message including the 
`Error in ... :` prefix, so the length check was wrong. I've applied your 
suggestion so `warning.length` is always raised to 8170 while the error is 
signalled, and updated the comment above it (579d734). The existing test still 
checks that the option is 8170 while signalled and restored afterwards. I 
couldn't run the R tests locally this time, so I'm relying on CI for that.



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