throw MessageException when Guard.MainFile not found.

This commit is contained in:
ChsBuffer
2021-03-01 23:14:12 +08:00
parent eab0797fb2
commit e03fe9fec9

View File

@@ -17,15 +17,15 @@ namespace Netch.Controllers
{
private readonly Timer _flushFileStreamTimer = new(300) {AutoReset = true};
private FileStream? _logFileStream;
private StreamWriter? _logStreamWriter;
/// <summary>
/// 日志文件(重定向输出文件)
/// </summary>
private string LogPath => Path.Combine(Global.NetchDir, $"logging\\{Name}.log");
private FileStream? _logFileStream;
private StreamWriter? _logStreamWriter;
/// <summary>
/// 成功启动关键词
/// </summary>
@@ -107,6 +107,9 @@ namespace Netch.Controllers
WindowStyle = ProcessWindowStyle.Hidden
}
};
if (!File.Exists(Instance.StartInfo.FileName))
throw new MessageException(i18N.Translate($"bin\\{MainFile} file not found!"));
}
/// <summary>