diff --git a/R/file_analysis.R b/R/file_analysis.R index bfdf677..445c73d 100644 --- a/R/file_analysis.R +++ b/R/file_analysis.R @@ -45,8 +45,8 @@ request_file_analysis <- function(con, res <- send_request(con, request) - if (handle_err_result(res)) { - return(NULL) + if (res$type == "error") { + return(list(error = res$reason)) } return(list(id = id, filetoken = filetoken, res = res)) diff --git a/R/slice.R b/R/slice.R index 8d4b02d..bbf75cc 100644 --- a/R/slice.R +++ b/R/slice.R @@ -20,8 +20,8 @@ request_slice <- function(con, filetoken, criteria, id = get_new_id()) { ) res <- send_request(con, request) - if (handle_err_result(res)) { - return(NULL) + if (res$type == "error") { + return(list(error = res$reason)) } return(list(id = id, res = res)) diff --git a/R/utils.R b/R/utils.R index 62e4cc1..27e5145 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,10 +1,3 @@ -handle_err_result <- function(res) { - if (res$type == "error") { - return(TRUE) - } - return(FALSE) -} - make_id_provider <- function(next_id = 0) { function() { next_id <<- next_id + 1