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

500 error in unAPI view with Hathi bibliography lookup fails #269

Open
rlskoeser opened this issue Mar 4, 2019 · 1 comment
Open

500 error in unAPI view with Hathi bibliography lookup fails #269

rlskoeser opened this issue Mar 4, 2019 · 1 comment
Labels

Comments

@rlskoeser
Copy link
Contributor

Maybe a sporadic error; when I tried the hathi bib record API url that had an error, it worked for me. Or possibly Hathi throttles those APIs as well, if someone hits them too much? This is possibly not a real-world error, the error email indicated a large number of strange cookies and several unAPI URLs were hit in succession, so likely this was triggered by something crawling the site.

Not sure the best way to handle; maybe catch the HathiItemNotFound and return a brief error message with a 503 Service Unavailable code?

Stack trace from the error email:


HathiItemNotFound at /unapi/
No exception message supplied

Traceback:  

File "/var/www/prosody/env/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/var/www/prosody/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/var/www/prosody/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/var/www/prosody/env/lib/python3.6/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/var/www/prosody/env/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/var/www/prosody/ppa/unapi/views.py" in get
  42.                 content=self.get_metadata(item_id, metadata_format),

File "/var/www/prosody/ppa/unapi/views.py" in get_metadata
  65.         return item.get_metadata(data_format)

File "/var/www/prosody/ppa/archive/models.py" in get_metadata
  588.                 bibdata = bib_api.record('htid', self.source_id)

File "/var/www/prosody/ppa/archive/hathi.py" in record
  81.         return self._get_record('full', id_type, id_value)

File "/var/www/prosody/ppa/archive/hathi.py" in _get_record
  64.                 raise HathiItemNotFound

Exception Type: HathiItemNotFound at /unapi/

Request information:
USER: AnonymousUser

GET:
id = 'hvd.hwssft'
format = 'marc'

POST: No POST data

FILES: No FILES data
@rlskoeser rlskoeser added the bug label Mar 4, 2019
@rlskoeser
Copy link
Contributor Author

We likely don't need to fix this if revisit how we handle zotero integration to include ppa urls and add support for excerpts etc #404

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