better error reporting on generation failures
This commit is contained in:
parent
8bc2cde163
commit
caf012be1e
1 changed files with 2 additions and 1 deletions
|
|
@ -27,12 +27,13 @@ const regenerate = () => {
|
|||
try { JSON.parse(json) }
|
||||
catch(e) {
|
||||
valid = false
|
||||
console.error('Failed to JSON.parse:', json)
|
||||
console.error(e)
|
||||
}
|
||||
const validation = `JSON is ${valid ? 'valid ✅' : 'invalid ❌'}`
|
||||
jsonOutputDiv.innerText = `${validation}\n\n${json}`
|
||||
} catch(e) {
|
||||
jsonOutputDiv.innerText = `JSON Generation Failed:\n${e}`
|
||||
jsonOutputDiv.innerText = `JSON Generation Failed for:\n${json}\n\n Failed with ${e}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue