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

Origins API for Pypi throwing 500 Error #1182

Open
yashkohli88 opened this issue Aug 21, 2024 · 0 comments
Open

Origins API for Pypi throwing 500 Error #1182

yashkohli88 opened this issue Aug 21, 2024 · 0 comments

Comments

@yashkohli88
Copy link
Contributor

yashkohli88 commented Aug 21, 2024

Origins API for Pypi throwing 500 Error

The origins API is publicly exposed and can be used by everyone. We use these APIs particularly in UI where we try to find the component to harvest.

Expected Behavior:

The origins API for Pypi should return an empty response when the package searched is not found.

Observed:

The origins API for Pypi is currently throwing an unhandled error with status code 500 when the searched package is not found in the package manager. However the innererror statusCode is 404 and message is Not Found.

Steps to Reproduce:

  1. Hit the endpoint https://dev-api.clearlydefined.io/origins/pypi/pand with a GET request where "pand" is the package being searched.
  2. Observe the response, error code and error message.

Additional Information:

The statement on line 27 of the originPypi.js file calls for https://pypi.org/pypi/pand/json when we search for pand string in the pypi. It returns 404 status code with message Not found if the package searched is not present. We should handle this error response around this line and throw error only if other status codes are returned.

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

No branches or pull requests

1 participant