From 35eab74d8331ae6894b4c946397659922906c129 Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 5 Jul 2018 16:02:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor/CommandMachine.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Editor/CommandMachine.ts b/src/Editor/CommandMachine.ts index 114ca0b20..78eb69a46 100644 --- a/src/Editor/CommandMachine.ts +++ b/src/Editor/CommandMachine.ts @@ -30,7 +30,15 @@ export class CommandMachine //命令执行... this.m_CommandIng = true; app.m_Editor.m_CommandStore.isCmdIng = true; - await this.m_CommandList.get(cmdName).exec(ss); + try + { + await this.m_CommandList.get(cmdName).exec(ss); + } + catch (error) + { + app.m_Editor.m_CommandStore.Prompt("抱歉,命令造成了错误,请联系开发人员."); + console.error(error); + } this.CommandEnd(cmdName); } else