From d3270f8df0b6282e11bb193a3d1775e575b0fe5d Mon Sep 17 00:00:00 2001 From: echicken <> Date: Mon, 15 Sep 2014 06:22:57 +0000 Subject: [PATCH] Comments, don't crap out on a command error. --- exec/menushell.js | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/exec/menushell.js b/exec/menushell.js index 937c1a7b8e..4150e1aa33 100644 --- a/exec/menushell.js +++ b/exec/menushell.js @@ -1,3 +1,26 @@ +/* Menu Shell - uses menus created via 'menuedit.js' + + Create your menus by running the following in your exec directory: + + jsexec menuedit.js + + Install the shell by first compiling the Baja launcher stub: + + baja menushel.src + + Then add the command shell to your configuration: + + scfg + Command Shells + (Add a new entry) + Command Shell Name: Menu Shell + Command Shell Internal Code: MENUSHEL + + This is not an example command shell. See classic_shell.js or lbshell.js + for examples of how to write your own shell, and consult Synchronet's JS + Object model documentation (http://synchro.net/docs/jsobjs.html) for help. +*/ + load("sbbsdefs.js"); load("menu-commands.js"); @@ -47,11 +70,15 @@ var doMenu = function() { if(typeof command.menu != "undefined") { menu = command.menu; } else { - var path = command.command.split("."); - if(path[1] == "Externals") - bbs.exec_xtrn(path[2]); - else - Commands[path[1]][path[2]].Action(); + try { // Let's not lose the entire session because of a bad command. + var path = command.command.split("."); + if(path[1] == "Externals") + bbs.exec_xtrn(path[2]); + else + Commands[path[1]][path[2]].Action(); + } catch(err) { + log(LOG_ERR, err); + } } } -- GitLab