From 070ccc4fbbcbfba62e794dbc81aba1688aadf1c9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 24 May 2019 12:06:01 +0300 Subject: [PATCH] feature(user-menu) imrove error output --- client/modules/user-menu/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/modules/user-menu/index.js b/client/modules/user-menu/index.js index d76733b5..0494b42b 100644 --- a/client/modules/user-menu/index.js +++ b/client/modules/user-menu/index.js @@ -75,9 +75,8 @@ async function show() { function fillTemplate(options) { const result = []; - for (const option of options) { + for (const option of options) result.push(``); - } return result.join(''); } @@ -125,7 +124,12 @@ const runUserMenu = async (value, options, userMenu) => { tryToCatch, }); - if (e) - Dialog.alert(e.stack); + if (!e) + return; + + if (e.name === 'Error') + return Dialog.alert(e.message); + + return Dialog.alert(e.stack); };