mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
Also limit the size of the error message in case it is
build by a concatenation of stack traces, i.e., ```js throw new Error(err + err.stack) ```
This commit is contained in:
parent
0f31d6cbf7
commit
9dda28def4
1 changed files with 6 additions and 5 deletions
|
@ -40,11 +40,12 @@ function _updateQA(html, fadeTime, onupdate, onshown) {
|
|||
qa.html(html);
|
||||
} catch (err) {
|
||||
qa.html(
|
||||
"Invalid HTML on card: " +
|
||||
err +
|
||||
("\n" + err.stack)
|
||||
.substring(0, 2000)
|
||||
.replace(/\n/g, "<br />")
|
||||
(
|
||||
`Invalid HTML on card: ${String(err).substring(
|
||||
0,
|
||||
2000
|
||||
)}\n` + String(err.stack).substring(0, 2000)
|
||||
).replace(/\n/g, "<br />")
|
||||
);
|
||||
}
|
||||
_runHook(onUpdateHook);
|
||||
|
|
Loading…
Reference in a new issue