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 response = await fetch(url, {
|
||||
method: 'GET',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
}
|
||||
mode: 'cors'
|
||||
});
|
||||
const html = await response.text();
|
||||
const dom = new JSDOM(html);
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
let currentSummary: string;
|
||||
|
||||
prompt.subscribe((val) => {
|
||||
console.log(val);
|
||||
currentSummary = JSON.parse(val);
|
||||
try {
|
||||
currentSummary = JSON.parse(val);
|
||||
} catch (e) {
|
||||
console.log(val);
|
||||
console.log((e as App.Error).message);
|
||||
alert(JSON.stringify(val));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue