File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -250,19 +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 .warn (' Failed to authenticate with ' .. provider_name .. ' : ' .. headers )
255+ log .error (' Failed to authenticate with ' .. provider_name .. ' : ' .. headers_or_err )
256+ error (headers_or_err )
256257 return {}
257258 end
258259
259- local ok , models = pcall (provider .get_models , headers )
260+ local ok , models_or_err = pcall (provider .get_models , headers_or_err )
260261 if not ok then
261- log .warn (' Failed to fetch models from ' .. provider_name .. ' : ' .. models )
262+ log .error (' Failed to fetch models from ' .. provider_name .. ' : ' .. models_or_err )
263+ error (models_or_err )
262264 return {}
263265 end
264266
265- return models or {}
267+ return models_or_err or {}
266268 end ))
267269 do
268270 model .provider = provider_name
You can’t perform that action at this time.
0 commit comments