Skip to content

Commit ab5d005

Browse files
committed
debug
1 parent 7d11912 commit ab5d005

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/CopilotChat/client.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ function Client:models()
255255
log.error('Failed to authenticate with ' .. provider_name .. ': ' .. headers)
256256
local user_err_msg = 'Failed to authenticate with ' .. provider_name
257257
-- 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
258+
local headers_json = utils.json_decode(headers)
259+
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
260261
end
261262
error(user_err_msg)
262263
return {}

0 commit comments

Comments
 (0)