feature(user-menu) imrove error output

This commit is contained in:
coderaiser 2019-05-24 12:06:01 +03:00
parent f80f87d77d
commit 070ccc4fbb

View file

@ -75,9 +75,8 @@ async function show() {
function fillTemplate(options) {
const result = [];
for (const option of options) {
for (const option of options)
result.push(`<option>${option}</option>`);
}
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);
};