From 469fe577f2d2b92cb7a63ac5cae07d9c3d130f5c Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 11 Feb 2020 11:48:02 +0200 Subject: [PATCH] Wrap stdout parsing from yarn into try/catch --- src/command-line/utils.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/command-line/utils.js b/src/command-line/utils.js index ada81bc6..3837a3a8 100644 --- a/src/command-line/utils.js +++ b/src/command-line/utils.js @@ -132,10 +132,16 @@ class Utils { .trim() .split("\n") .forEach((line) => { - line = JSON.parse(line); + try { + line = JSON.parse(line); - if (line.type === "success") { - success = true; + if (line.type === "success") { + 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 } }); });