diff --git a/DESCRIPTION b/DESCRIPTION index 6022b9c..b5c6545 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: extractus Title: Extract chemical info from various databases -Version: 0.0.4 +Version: 0.0.5 Authors@R: person(given = "Claudio", family = "Zanettini", diff --git a/NAMESPACE b/NAMESPACE index cec2168..2aafef1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand -export(extr_casrn_from_cid) export(extr_chem_info) export(extr_comptox) export(extr_ctd) diff --git a/R/extr_ctd.R b/R/extr_ctd.R index d576442..a53b536 100644 --- a/R/extr_ctd.R +++ b/R/extr_ctd.R @@ -119,7 +119,7 @@ extr_ctd <- function( httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) @@ -207,7 +207,7 @@ extr_tetramer_ <- function( httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) diff --git a/R/extr_tox.R b/R/extr_tox.R index 1c4cdb0..a0a62dc 100644 --- a/R/extr_tox.R +++ b/R/extr_tox.R @@ -39,7 +39,7 @@ extr_iris_ <- function(keyword = NULL, httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) @@ -54,7 +54,7 @@ extr_iris_ <- function(keyword = NULL, rvest::html_table() }, error = function(e) { - cli::cli_abort("Failed to parse the HTML content: {e$message}") + cli::cli_abort("Failed to parse the HTML content: {conditionMessage(e)}") } ) @@ -283,7 +283,7 @@ extr_comptox <- function(ids, httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) @@ -302,7 +302,7 @@ extr_comptox <- function(ids, httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) @@ -364,7 +364,7 @@ extr_ice <- function(casrn, assays = NULL, verify_ssl = FALSE, ...) { httr2::req_perform() }, error = function(e) { - cli::cli_abort("Failed to perform the request: {e$message}") + cli::cli_abort("Failed to perform the request: {conditionMessage(e)}") } ) @@ -391,10 +391,10 @@ extr_ice <- function(casrn, assays = NULL, verify_ssl = FALSE, ...) { }, error = function(e) { if (grepl("Unexpected content type \"text/plain\"", e$message)) { - cli::cli_warn("It seems that the ids were not found in ICE: {e$message}") + cli::cli_warn("It seems that the ids were not found in ICE: {conditionMessage(e)}") NULL # Or another suitable value } else { - cli::cli_abort("An unexpected error occurred: {e$message}") + cli::cli_abort("An unexpected error occurred: {conditionMessage(e)}") } } ) @@ -410,7 +410,7 @@ extr_ice <- function(casrn, assays = NULL, verify_ssl = FALSE, ...) { as.data.frame() }, error = function(e) { - cli::cli_abort("Failed to parse the JSON content: {e$message}") + cli::cli_abort("Failed to parse the JSON content: {conditionMessage(e)}") } ) } diff --git a/man/extr_pubchem_fema.Rd b/man/extr_pubchem_fema.Rd index 41c5cec..9d996cd 100644 --- a/man/extr_pubchem_fema.Rd +++ b/man/extr_pubchem_fema.Rd @@ -18,7 +18,7 @@ This function retrieves FEMA (Flavor and Extract Manufacturers Association) flav \examples{ \dontrun{ casrn_list <- c("64-17-5", "50-00-0") -result <- extr_fema_pubchem(casrn_list) +result <- extr_pubchem_fema(casrn_list) print(result) } } diff --git a/man/extr_pubchem_ghs.Rd b/man/extr_pubchem_ghs.Rd index 87040c5..99060a3 100644 --- a/man/extr_pubchem_ghs.Rd +++ b/man/extr_pubchem_ghs.Rd @@ -17,7 +17,7 @@ This function extracts GHS (Globally Harmonized System) codes from PubChem. It r } \examples{ \dontrun{ -ghs_info <- extr_ghs_pubchem(casrn = c("50-00-0", "64-17-5")) +ghs_info <- extr_pubchem_ghs(casrn = c("50-00-0", "64-17-5")) ghs_info } }