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

fix cran malformat error #269

Merged
merged 11 commits into from
Oct 19, 2024
Merged

fix cran malformat error #269

merged 11 commits into from
Oct 19, 2024

Conversation

elena-krismer
Copy link
Collaborator

@elena-krismer elena-krismer commented Oct 17, 2024

I couldn't reproduce the error, but here’s what I discovered:

In some cases, tryCatchseems to struggle with capturing errors from C-level functions. Additionally, the error from curl::curl_fetch_memory() isn't being handled properly (see the screenshot below). The error message appears similar, but it's not exactly the same.

Screenshot 2024-10-17 at 18 01 56

The error message suggests the url is invalid, so for now, I’ve added an extra validation test to check the URL’s format before proceeding. It seems the issue might stem from some unusual behavior in the interaction between R and C functions, where the original URL possibly "gets lost."

@elena-krismer elena-krismer changed the base branch from master to developer October 17, 2024 16:35
The issue was that the uniprot data seems to now be gziped. I handle this case now in try_query. Not sure if it is generally handled for any potential case but it at least works for uniprot.
@jpquast
Copy link
Owner

jpquast commented Oct 19, 2024

@elena-krismer It is great that you managed to reproduce a similar error message. That helped me to figure out what was actually going on. I assumed the error came from httr::GET but it actually came from httr::http_error as you can see from your screenshot.
In brief, the function handles errors that arise during requests correctly, but if the error is not a standard response error but actually an error with one of the functions then the httr::http_error function tries to retrieve information from a "URL" that is the error message. So I added some code that handles request errors separately from function errors. This should fix it.

Copy link
Owner

@jpquast jpquast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good currently. I will wait until the tests passed and merge it into the developer. Then I bump the version and write the cran_comments.

@jpquast jpquast merged commit a426c0a into developer Oct 19, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants