-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sanic exceptions #914
Comments
There might be a bug with
And Maybe you can try:
or
|
Actually, I was just testing it. Yes, the Unauthorized exception needs a scheme argument .From source code: def __init__(self, message, scheme, **kwargs):
super().__init__(message)
values = ["{!s}={!r}".format(k, v) for k, v in kwargs.items()]
challenge = ', '.join(values)
self.headers = {
"WWW-Authenticate": "{} {}".format(scheme, challenge).rstrip()
} This might be a solution? def __init__(self, message, scheme=None, **kwargs): |
r0fls
added a commit
that referenced
this issue
Aug 24, 2017
fix #914, change arguments of Unauthorized.__init__
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How does sanic exceptions are supposed to work? The docs states that
This is my route
When I make a request on the path I get a response of :
2017-08-24 10:18:43 - (sanic)[ERROR]: Traceback (most recent call last): File "/home/nikos/.virtualenvs/3.6/lib/python3.6/site-packages/sanic/app.py", line 503, in handle_request response = await response File "/home/nikos/Desktop/Side Projects/micro/test2.py", line 15, in test abort(401) File "/home/nikos/.virtualenvs/3.6/lib/python3.6/site-packages/sanic/exceptions.py", line 262, in abort raise sanic_exception(message=message, status_code=status_code) TypeError: __init__() missing 1 required positional argument: 'scheme'
Also after a bit the connection times out and the log trace is
2017-08-24 10:18:43 - (network)[INFO][127.0.0.1:34734]: GET http://0.0.0.0:8001/ 500 144 2017-08-24 10:19:43 - (sanic)[ERROR]: Traceback (most recent call last): File "/home/nikos/.virtualenvs/3.6/lib/python3.6/site-packages/sanic/server.py", line 143, in connection_timeout raise RequestTimeout('Request Timeout') sanic.exceptions.RequestTimeout: Request Timeout
The text was updated successfully, but these errors were encountered: