display error in alert for debugging
This commit is contained in:
parent
f3eda31c48
commit
d93eea3034
|
@ -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);
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue