Skip to content

Commit 802d81d

Browse files
committed
refactor: name to reflect object variability
1 parent 212b884 commit 802d81d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lua/CopilotChat/client.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,21 +250,21 @@ function Client:models()
250250
ipairs(get_cached(self.provider_cache[provider_name], 'models', function()
251251
notify.publish(notify.STATUS, 'Fetching models from ' .. provider_name)
252252

253-
local ok, headers = pcall(self.authenticate, self, provider_name)
253+
local ok, headers_or_err = pcall(self.authenticate, self, provider_name)
254254
if not ok then
255-
log.error('Failed to authenticate with ' .. provider_name .. ': ' .. headers)
256-
error(headers)
255+
log.error('Failed to authenticate with ' .. provider_name .. ': ' .. headers_or_err)
256+
error(headers_or_err)
257257
return {}
258258
end
259259

260-
local ok, models = pcall(provider.get_models, headers)
260+
local ok, models_or_err = pcall(provider.get_models, headers_or_err)
261261
if not ok then
262-
log.warn('Failed to fetch models from ' .. provider_name .. ': ' .. models)
263-
error(models)
262+
log.warn('Failed to fetch models from ' .. provider_name .. ': ' .. models_or_err)
263+
error(models_or_err)
264264
return {}
265265
end
266266

267-
return models or {}
267+
return models_or_err or {}
268268
end))
269269
do
270270
model.provider = provider_name

0 commit comments

Comments
 (0)