Skip to content

Commit

Permalink
rethrow
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 27, 2024
1 parent 92bdd0a commit e6e7172
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions R/rethrow-gen.R
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,27 @@ rethrow_rapi_rel_from_table_function <- function(con, function_name, positional_
)
}

rethrow_rapi_rel_to_altrep <- function(rel, call = parent.frame(2)) {
rethrow_rapi_get_last_rel_mat <- function(call = parent.frame(2)) {
rlang::try_fetch(
rapi_rel_to_altrep(rel),
rapi_get_last_rel_mat(),
error = function(e) {
rethrow_error_from_rapi(e, call)
}
)
}

rethrow_rapi_rel_from_altrep_df <- function(df, strict, allow_materialized, call = parent.frame(2)) {
rethrow_rapi_rel_to_altrep <- function(rel, allow_materialization = TRUE, call = parent.frame(2)) {
rlang::try_fetch(
rapi_rel_from_altrep_df(df, strict, allow_materialized),
rapi_rel_to_altrep(rel, allow_materialization = TRUE),
error = function(e) {
rethrow_error_from_rapi(e, call)
}
)
}

rethrow_rapi_rel_from_altrep_df <- function(df, strict, allow_materialized, enable_materialization, call = parent.frame(2)) {
rlang::try_fetch(
rapi_rel_from_altrep_df(df, strict, allow_materialized, enable_materialization),
error = function(e) {
rethrow_error_from_rapi(e, call)
}
Expand Down Expand Up @@ -575,6 +584,7 @@ rethrow_restore <- function() {
rethrow_rapi_rel_from_sql <<- rapi_rel_from_sql
rethrow_rapi_rel_from_table <<- rapi_rel_from_table
rethrow_rapi_rel_from_table_function <<- rapi_rel_from_table_function
rethrow_rapi_get_last_rel_mat <<- rapi_get_last_rel_mat
rethrow_rapi_rel_to_altrep <<- rapi_rel_to_altrep
rethrow_rapi_rel_from_altrep_df <<- rapi_rel_from_altrep_df
rethrow_rapi_release <<- rapi_release
Expand Down

0 comments on commit e6e7172

Please sign in to comment.