unyt-org / uix

The UIX Framework
https://uix.unyt.org
MIT License
54 stars 3 forks source link

[Uncaught Promise] UIX CLI: DNS error when offline #147

Open asbng opened 3 months ago

asbng commented 3 months ago

🕗 Version & Regression Information

UIX v0.2.6

💻 Code

uix

🙁 Actual behavior

When being offline or having an unstable internet connection, the following error is thrown when starting the UIX CLI

Uncaught promise: Promise {
  <rejected> TypeError: error sending request for url (https://cdn.unyt.org/uix/VERSION): error trying to connect: dns error: failed to lookup address information: Name or service not known
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:391:7)
    at async Path.getTextContent (https://cdn.unyt.org/uix/src/utils/path.ts:298:16)
    at async handleAutoUpdate (https://cdn.unyt.org/uix/auto-update.ts:10:26)
    at async https://cdn.unyt.org/uix/run.ts:68:5
}
error: Uncaught (in promise) TypeError: error sending request for url (https://cdn.unyt.org/uix/VERSION): error trying to connect: dns error: failed to lookup address information: Name or service not known
            const res = await fetch(this);
                        ^
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:391:7)
    at async Path.getTextContent (https://cdn.unyt.org/uix/src/utils/path.ts:298:16)
    at async handleAutoUpdate (https://cdn.unyt.org/uix/auto-update.ts:10:26)
    at async https://cdn.unyt.org/uix/run.ts:68:5

🙂 Expected behavior

Error handling according to #144

Additional information about the issue

No response