ArtVentureX / sd-webui-agent-scheduler

627 stars 65 forks source link

fix : APIError, infotexts can be None #181

Closed aria1th closed 10 months ago

aria1th commented 10 months ago
*** API error: GET: http://127.0.0.1:9051/agent-scheduler/v1/results/1699316c-6a81-45a5-812b-042f70d2bc11 {'error': 'KeyError', 'detail': '', 'body': '', 'errors': "'infotexts'"}               | 17/46 [00:09<00:06,  4.57it/s]
    Traceback (most recent call last):
      File "/data/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 98, in receive
        return self.receive_nowait()
      File "/data/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
        raise WouldBlock
    anyio.WouldBlock

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/data/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 78, in call_next
        message = await recv_stream.receive()
      File "/data/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 118, in receive
        raise EndOfStream
    anyio.EndOfStream

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/data/stable-diffusion-webui/modules/api/api.py", line 187, in exception_handling
        return await call_next(request)

      File "/data/stable-diffusion-webui/extensions/sd-webui-agent-scheduler/agent_scheduler/api.py", line 448, in get_task_results
        infotexts = result["infotexts"]
    KeyError: 'infotexts'
artventuredev commented 10 months ago

Thank you for the PR. I have made a proper fix in the main branch so I'll close this one.