diff --git a/src/MeoAssistant/AbstractConfiger.cpp b/src/MeoAssistant/AbstractConfiger.cpp index 2e45d06412..ee7c46a762 100644 --- a/src/MeoAssistant/AbstractConfiger.cpp +++ b/src/MeoAssistant/AbstractConfiger.cpp @@ -36,5 +36,9 @@ bool asst::AbstractConfiger::load(const std::string& filename) m_last_error = std::string("json field error ") + e.what(); return false; } + catch (std::exception& e) { + m_last_error = std::string("json field error ") + e.what(); + return false; + } return true; } diff --git a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs index be4b002e7d..9f4d498055 100644 --- a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs +++ b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs @@ -47,7 +47,7 @@ namespace MeoAsstGui //LogItemViewModels.Insert(0, new LogItemViewModel(time + content, color, weight)); } - public void AddLogWithUrl(string content,string url, string color = "Gray", string weight = "Regular") + public void AddLogWithUrl(string content, string url, string color = "Gray", string weight = "Regular") { LogItemViewModels.Add(new LogItemViewModel(content, color, weight)); //LogItemViewModels.Insert(0, new LogItemViewModel(time + content, color, weight)); @@ -232,9 +232,16 @@ namespace MeoAsstGui const string _newfilename = "resource/_temp_copilot.json"; File.WriteAllText(_newfilename, data.ToString()); - asstProxy.AsstStartCopilot(data["stage_name"].ToString(), _newfilename, Form); - Idle = false; - AddLog("Star Burst Stream!"); + bool ret = asstProxy.AsstStartCopilot(data["stage_name"].ToString(), _newfilename, Form); + if (ret) + { + Idle = false; + AddLog("Star Burst Stream!"); + } + else + { + AddLog("读取 JSON 作业文件出错\n请检查文件内容", "darkred"); + } } public void Stop()