-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
More debug logging #142
More debug logging #142
Conversation
Logging changes look good. We seem to raise a LOT of class NotFoundError(Exception):
pass
class NoSuchPackage(NotFoundError):
pass
class NoCompatibleWheel(NotFoundError):
pass and then raise these in |
I'm not 100% sure about the hierarchy, the problem is (to me) that And Maybe I'll split the logging into it's own things and then refactor the various errors. |
Basically still trying to make the proxy works, but so many errors are swallowed because everything that triggers a ValueError is just ignore. So add a bunch of debug to at least be able to debug. async def add_requirement_inner( self, req: Requirement, ) -> None: .... try: if self.search_pyodide_lock_first: ... else: try: await self._add_requirement_from_package_index(req) except ValueError: # basically this swallow things it should not, like improper content type and likely a bunch of other. This is where many ValueError are swallowed, I will send more changes to change various error types.
caf8236
to
dfdc26b
Compare
ValueError
s
I removed the change of exceptions and will send a subsequent PR. |
case ( | ||
"application/vnd.pypi.simple.v1+html" | ||
| "text/html" | ||
| "text/html; charset=utf-8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there is also this change, but it seems minor enough and correct enough to merge without worrying too much.
Thanks! |
I guess in that case the two catch blocks can be:
or something? |
ValueErrors are a bit too generic, and by raising/catching them we loose a potential useful information; For example an invalid content type for the index, is dealt as the same way than a missing wheel. This introduces new exceptions for various cases, ant stop catching the now UnsupportedContentTypeError, as I believe it should be a hard error as we are likely having either an error with the index software, or a user configuraition error. See also beginning of discussion in pyodide#142
Yep, except on Python 3 you need parentheses :-) |
Basically still trying to make the proxy works, but so many errors are swallowed because everything that triggers a ValueError is just ignore. So add a bunch of debug to at least be able to debug.
This is where many ValueError are swallowed, I will send more changes to
change various error types.