koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 13 forks source link

Handle 504 in DOI Fetcher #102

Closed koppor closed 5 months ago

koppor commented 8 years ago

When using "DOI to BibTeX" with http://dx.doi.org/10.1145/2460383.2460389, following exception occurs:

java.io.IOException: Server returned HTTP response code: 504 for URL: http://data.crossref.org/10.1145%2F2460383.2460389
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at net.sf.jabref.util.Util.getResultsWithEncoding(Util.java:651)
    at net.sf.jabref.importer.fetcher.DOItoBibTeXFetcher.getEntryFromDOI(DOItoBibTeXFetcher.java:111)

No output to the user is made. This should be changed.

koppor commented 1 year ago

Steps:

  1. Create a test case in org.jabref.logic.importer.fetcher.DoiFetcherTest
  2. The test should fetch the data from the doi 10.1145/2460383.2460389,
  3. Check what the result is
  4. Is it an exception? Is it an empty entry?
  5. Think of the expected result.
akashpal6394 commented 9 months ago

Hello I am new to open source and i am interested in this problem so please assigne this problem .

koppor commented 9 months ago

@akashpal6394 Sure! Go ahead!

Remember that this issue is 8 years old - and JabRef might behave differently now. -- In all cases, a test case for the specific DOI is highly welcome.

Find general information on fetchers at https://devdocs.jabref.org/code-howtos/fetchers.html.


As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

InAnYan commented 5 months ago

There is no error for this DOI, I've tested in the app and created a test method. No errors, so maybe this issue is not relevant now.

However, probably there still no logic for handling 504 error in the code

koppor commented 5 months ago

I'll just close the issue.

504 handling still should be added, but hard to test (because one needs to use WireMock - https://stackoverflow.com/q/30165792/873282).