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

Task exception wasn't retrieved future: <Task> coro= <generator object '_handle_request' at 20015230> Traceback (most recent call last): File "asyncio/core.py", line 1, in run_until_complete File "/lib/phew/server.py", line 277, in _handle_request AttributeError: 'NoneType' object has no attribute 'status' #61

Open
jevylux opened this issue Jun 11, 2024 · 2 comments

Comments

@jevylux
Copy link

jevylux commented Jun 11, 2024

I have a problem with the following code running on a raspberry pico with the image RPI_PICO_W-20240602-v1.23.0.uf2

`from phew import connect_to_wifi, server
from machine import Pin, PWM
import json

import network_cred
ip = connect_to_wifi(network_cred.SSID, network_cred.PASSWORD)
print("Connected to IP", ip)

.....

@server.route("/api/control-led", methods=["POST"])
def ledCommand(request):

set_pwm_rgb(pwm_red, request.data["ledRed"])
set_pwm_rgb(pwm_green, request.data["ledGreen"])
set_pwm_rgb(pwm_blue, request.data["ledBlue"])
return json.dumps({"message": "Command sent successfully!"}), 200, {"Content-Type": "application/json"}

@server.catchall()
def catchall(request):
return "Not found", 404

server.run()`

When sending a POST request i get the following error :

Task exception wasn't retrieved
future: coro= <generator object '_handle_request' at 20015230>
Traceback (most recent call last):
File "asyncio/core.py", line 1, in run_until_complete
File "/lib/phew/server.py", line 277, in _handle_request
AttributeError: 'NoneType' object has no attribute 'status'

@andrewpbrooker
Copy link

Hi

I am getting the same error as you

Did you get anywhere with it ?

Thanks

Andy

@jevylux
Copy link
Author

jevylux commented Oct 14, 2024 via email

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

2 participants