unpywall
unpywall copied to clipboard
Handle connection errors in cache?
Failed requests should not be saved.
A report should be generated with the DOIs that have led to failed requests.
This was raised as part of the discussion in issue #12
@naustica Could you talk a little bit more about what you mean by a report?
something like: Report
Out of seven dois, two were invalid.
doi | error |
---|---|
10.3253/dga.dsfs | Unpaywall response |
10.214134/afsaf | Timeout... |
Or do you have a better idea?
ok, the table has just been converted to markdown. Imagine that as a plain python table
Ok. Right now dois are requested one-by-one, so I guess it would make sense to add a function that takes in a list of dois and then prints this report to the console, if the console is the best place.
@naustica What do you think about just a warning?
@bganglia I dont know. I associate warnings with internal problems. But this is more of an external one. Or? But we can do that.
@naustica Now that I think about it, a report would probably be easier to read anyway. Printing out a report sounds good to me.
@bganglia Python provides also the tempfile module (https://docs.python.org/3.7/library/tempfile.html) which creates a temporary file that we could use to store dois from faulty connections. So we can create a temporary txt file that the user has access to. The tempfile would only exist for one session (I think) which is also nice.