Wrap stdout parsing from yarn into try/catch

This commit is contained in:
Pavel Djundik 2020-02-11 11:48:02 +02:00
parent 1fb78d7218
commit 469fe577f2

View File

@ -132,10 +132,16 @@ class Utils {
.trim() .trim()
.split("\n") .split("\n")
.forEach((line) => { .forEach((line) => {
line = JSON.parse(line); try {
line = JSON.parse(line);
if (line.type === "success") { if (line.type === "success") {
success = true; success = true;
}
} catch (e) {
// Stdout buffer has limitations and yarn may print
// big package trees, for example in the upgrade command
// See https://github.com/thelounge/thelounge/issues/3679
} }
}); });
}); });