File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
2323 virtualConsole = new VirtualConsole(output);
2424
2525 input.addEventListener('submit', e => {
26- try {
27- handleSubmit();
28- } catch (e) {
29- console.error('Capo error', e);
30- }
26+ handleSubmit();
3127 e.preventDefault();
3228 return false;
3329 });
@@ -89,6 +85,11 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
8985 const proxy = new URL('https://capo.rviscomi.workers.dev/');
9086 proxy.searchParams.set('url', url);
9187 const response = await fetch(proxy);
88+ if (response.status == 502) {
89+ throw new Error(`502 Gateway Error. The URL ${url} cannot be fetched. (Possibly too many redirects)`);
90+ } else if (!response.ok) {
91+ throw new Error('Unknown error fetching the URL. Please file an issue: https://github.com/rviscomi/capo.js/issues/');
92+ }
9293 return await response.text();
9394 }
9495</script >
You can’t perform that action at this time.
0 commit comments