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

Getting Error in UseMethod("xml_find_first") : no applicable method for 'xml_find_first' applied to an object of class "try-error" #268

Closed
moradkhantig opened this issue Jul 7, 2020 · 3 comments
Assignees
Labels
bug Unexpected problem or unintended behavior

Comments

@moradkhantig
Copy link

I'm using the ci_query in the webchem package to query the ChemIDPlus database. Starting from July 2 I've been getting the following error when running the query:

Error in UseMethod("xml_find_first") :
no applicable method for 'xml_find_first' applied to an object of class "try-error"

This error is thrown even when I run the example provided in the documentation (https://cran.r-project.org/web/packages/webchem/webchem.pdf) on page 10:

y1 <- ci_query(c('Formaldehyde', 'Triclosan'), type = 'name')

@marcodilger
Copy link

same as #265
(does this happen when ChemIDPlus is temporarely not responding?)

@stitam
Copy link
Contributor

stitam commented Jul 7, 2020

Thanks for raising the issue @moradkhantig. This error message comes from the ci_query() being unable to read the url. This usually happens when the server is not responding (thanks @marcodilger for mentioning that) so I am quite certain the failure is on the webservice's end. I'll update the function to return HTTP status codes so next time we'll have a better clue.

@stitam stitam added the bug Unexpected problem or unintended behavior label Jul 7, 2020
@stitam stitam self-assigned this Jul 7, 2020
@stitam stitam linked a pull request Jul 13, 2020 that will close this issue
4 tasks
@stitam
Copy link
Contributor

stitam commented Sep 17, 2020

Hi @moradkhantig, in order to confirm webservice failures in the future, all functions that query webservices should now print http status messages by default. ci_query() seems to be working, so I am closing this issue, but let us know if the error comes back.

@stitam stitam closed this as completed Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants