Closed miikanissi closed 1 month ago
The reason is because we're checking errors with if err or vim.startswith(line, '{"error"') then
. When status != 200 and nothing is returned, it panics. The optimal solution would be to check for status but it's not available to stream
, only callback
.
When submitting an input to Copilot Chat which receives a Bad Request error this will cause the plugin to crash with the following:
Checking the CopilotChat logs I can see this:
I believe the "Bad Request" error from Copilot was caused by the query being too long. Regardless, I think the plugin should gracefully exit in this case and display an error instead of crashing.