Skip to content

Commit

Permalink
error code to stx_availability()
Browse files Browse the repository at this point in the history
  • Loading branch information
andschar committed Oct 4, 2021
1 parent cb31425 commit 9518919
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: standartox
Version: 0.0.1.9001
Date: 2021-10-02
Version: 0.0.1.9002
Date: 2021-10-04
Title: Ecotoxicological Information from the Standartox Database
Authors@R: c(
person("Andreas", "Scharmüller",
Expand Down
11 changes: 7 additions & 4 deletions R/standartox.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,13 @@ stx_meta = function(vers = NULL) {
#'
stx_availability = function(res,
http_codes = c(200, 400)) {
if (inherits(res, 'try-error') || ! httr::status_code(res) %in% http_codes) {
msg = '
The standartox web service seems currently unavailable. Please try again after some time. Should it still not work then, please file an issue here:
https://github.com/andschar/standartox/issues'
if (inherits(res, 'try-error') ||
! httr::status_code(res) %in% http_codes) {
msg = paste0(
'The standartox web service seems currently unavailable.
Please try again after some time. Should it still not work then, please file an issue here:
https://github.com/andschar/standartox/issues
Error code: ', res)
stop(msg)
}
}

0 comments on commit 9518919

Please sign in to comment.