display error in alert for debugging

This commit is contained in:
Silas 2023-04-10 00:34:25 -04:00
parent f3eda31c48
commit d93eea3034
Signed by: silentsilas
GPG Key ID: 4199EFB7DAA34349
2 changed files with 8 additions and 6 deletions

View File

@ -10,10 +10,7 @@ const parseSite = async (url: string) => {
const { JSDOM } = jsdom; const { JSDOM } = jsdom;
const response = await fetch(url, { const response = await fetch(url, {
method: 'GET', method: 'GET',
mode: 'cors', mode: 'cors'
headers: {
'Access-Control-Allow-Origin': '*'
}
}); });
const html = await response.text(); const html = await response.text();
const dom = new JSDOM(html); const dom = new JSDOM(html);

View File

@ -4,8 +4,13 @@
let currentSummary: string; let currentSummary: string;
prompt.subscribe((val) => { prompt.subscribe((val) => {
console.log(val); try {
currentSummary = JSON.parse(val); currentSummary = JSON.parse(val);
} catch (e) {
console.log(val);
console.log((e as App.Error).message);
alert(JSON.stringify(val));
}
}); });
</script> </script>