Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect$raise_error() prints a message even if the error is captured in tryCatch() #317

Open
toph-allen opened this issue Oct 23, 2024 · 0 comments
Assignees
Labels

Comments

@toph-allen
Copy link
Collaborator

This is problematic for handling endpoints that have different paths on different versions of Connect.

connectapi/R/connect.R

Lines 79 to 96 in adc2041

raise_error = function(res) {
if (httr::http_error(res)) {
err <- sprintf(
"%s request failed with %s",
res$request$url,
httr::http_status(res)$message
)
tryCatch(
{
message(capture.output(str(httr::content(res))))
},
error = function(e) {
message(e)
}
)
stop(err)
}
},

@toph-allen toph-allen self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant