-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This improve the handling of indexes and error messages. Before this PR all errors reaching an index would be ValueError, thus not finding a wheel was the same as the index page having a non-handled content type, or even failing to parse the html because of a typo. This made it hard to debug, or even realize that an index url was wrong, or that the pages served by the index were incorrect. I thus introduce 3 New Errors that do not inherit from `ValueError`: - IndexMetadataFetchError - UnsupportedParserContentTypeError - WheelNotFoundError The first two of which trigger real error, as they likely suggest a problem with the index or the user config, and should not be ignored. In addition the `verbose=` option was unconditionally setting the log level. I think this is improper as if the logging level is set somewhere else (to DEBUG, or something else), then it is overwritten. - This then adds the option to pass `verbose=None`, (and make it the default), in which case it will not change the default. python -m http.server will serve ContentType with `; charset=utf-8`, which is not recognized. - This now handle the case where the index ContentType header contains parameters for example `; charset=utf-8`, by discarding everything after the semicolon `;`; this is not proper parsing, but should be sufficient here. - I found that more debug logging would be useful and added a number of debug logs calls With this I appear to get proper error message and debug statements when trying to work on the Cors proxy. Should close #123, and #121, and help with pyodide/pyodide#4898
- Loading branch information
Showing
5 changed files
with
73 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters