Skip to content

Commit

Permalink
Refactor to avoid test failing early
Browse files Browse the repository at this point in the history
  • Loading branch information
wkmor1 committed Mar 11, 2024
1 parent 078a43b commit 19846a1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/finbif_request_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ finbif_request_token <- function(email, quiet = FALSE) {

if (!identical(resp[["status_code"]], 200L)) {

error <- parsed[["error"]]

msg <- sprintf(
"API request failed [%s]\n%s",
parsed[[c("error", "statusCode")]],
parsed[[c("error", "message")]]
"API request failed [%s]\n%s", error[["statusCode"]], error[["message"]]
)

stop(msg, call. = FALSE)
Expand All @@ -75,8 +75,7 @@ finbif_request_token <- function(email, quiet = FALSE) {
if (!quiet) {

message(
"A personal access token for api.laji.fi has been sent to: ",
email
"A personal access token for api.laji.fi has been sent to: ", email
)

}
Expand Down

0 comments on commit 19846a1

Please sign in to comment.