Skip to content

Commit 0fa8d55

Browse files
Copilotlpcox
andauthored
refactor: clean up fetchJson try-catch destructuring in buildRequest call
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/4eb4ca56-5f43-4a41-aa10-b29649ab9c9e Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 1a128e9 commit 0fa8d55

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

containers/api-proxy/model-discovery.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ function buildRequest(url, opts, timeoutMs) {
6666
*/
6767
function fetchJson(url, opts, timeoutMs) {
6868
return new Promise((resolve) => {
69-
let built;
70-
try { built = buildRequest(url, opts, timeoutMs); } catch { resolve(null); return; }
71-
const { mod, reqOpts } = built;
69+
let mod, reqOpts;
70+
try { ({ mod, reqOpts } = buildRequest(url, opts, timeoutMs)); } catch { resolve(null); return; }
7271

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

0 commit comments

Comments
 (0)