We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d11912 commit ab5d005Copy full SHA for ab5d005
lua/CopilotChat/client.lua
@@ -255,8 +255,9 @@ function Client:models()
255
log.error('Failed to authenticate with ' .. provider_name .. ': ' .. headers)
256
local user_err_msg = 'Failed to authenticate with ' .. provider_name
257
-- append error details, if available
258
- if headers.error_details and headers.error_details.message then
259
- user_err_msg = user_err_msg .. ' the server replied : ' .. headers.error_details.message
+ local headers_json = utils.json_decode(headers)
+ if headers_json.error_details and headers_json.error_details.message then
260
+ user_err_msg = user_err_msg .. ' the server replied : ' .. headers_json.error_details.message
261
end
262
error(user_err_msg)
263
return {}
0 commit comments