You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/05/24 13:47:14 UTC

[GitHub] [arrow-adbc] paleolimbot opened a new pull request, #703: feat(r): Improve error communication

paleolimbot opened a new pull request, #703:
URL: https://github.com/apache/arrow-adbc/pull/703

   Before this PR, errors coming from ADBC were rather unhelpfully labelled:
   
   ``` r
   library(adbcdrivermanager)
   
   db <- adbc_database_init(adbc_driver_void())
   adbc_database_release(db)
   adbc_database_release(db)
   #> Error in stop_for_error(status, error): ADBC_STATUS_INVALID_STATE (6)
   ```
   
   After this PR, the source of the error is better communicated and errors are given a custom class so they can be caught appropriately:
   
   ``` r
   library(adbcdrivermanager)
   
   db <- adbc_database_init(adbc_driver_void())
   adbc_database_release(db)
   adbc_database_release(db)
   #> Error in adbc_database_release(db): ADBC_STATUS_INVALID_STATE (6)
   
   tryCatch({
     db <- adbc_database_init(adbc_driver_void())
     adbc_database_release(db)
     adbc_database_release(db)
   }, adbc_status_invalid_state = function(e) {
     message(sprintf("Just warning for ADBC status with code %d", e$error$status))
   })
   #> Just warning for ADBC status with code 6
   ```
   
   <sup>Created on 2023-05-24 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup>


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


[GitHub] [arrow-adbc] paleolimbot merged pull request #703: feat(r): Improve error communication

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot merged PR #703:
URL: https://github.com/apache/arrow-adbc/pull/703


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