-
Notifications
You must be signed in to change notification settings - Fork 119
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
Catch MissingSchema errors that could be raised by requests #221
Comments
Perhaps the best solution would be to check URL in the api initiation code? from urllib3.util import parse_url
from urllib3.exceptions import LocationParseError
try:
scheme, auth, host, port, path, query, fragment = parse_url(url)
except LocationParseError as e:
raise MatrixError("Invalid homeserver url %s" % url)
if not scheme:
raise MatrixError("No scheme in homeserver url") |
Ya, that could definitely work. Would need to move |
Closed in #256 |
See here for example: https://github.com/matrix-org/matrix-python-sdk/pull/179/files#diff-730c26e17b5455de7bbc524b7a20dc2fR33
requests is an implementation detail, so we shouldn't allow end users to see any of its errors.
The text was updated successfully, but these errors were encountered: