Skip to content

Commit c2849d4

Browse files
lpcoxCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 0fa8d55 commit c2849d4

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

containers/api-proxy/model-discovery.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ function buildRequest(url, opts, timeoutMs) {
6767
function fetchJson(url, opts, timeoutMs) {
6868
return new Promise((resolve) => {
6969
let mod, reqOpts;
70-
try { ({ mod, reqOpts } = buildRequest(url, opts, timeoutMs)); } catch { resolve(null); return; }
70+
try {
71+
({ mod, reqOpts } = buildRequest(url, opts, timeoutMs));
72+
} catch (err) {
73+
if (err && err.code === 'ERR_INVALID_URL') {
74+
resolve(null);
75+
return;
76+
}
77+
throw err;
78+
}
7179

7280
let settled = false;
7381
const resolveOnce = (value) => { if (settled) return; settled = true; resolve(value); };

0 commit comments

Comments
 (0)