XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.ServerInteractive

[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.ServerInteractive

优化异常处理逻辑并更新项目版本号

- 调整 Program.cs 中 SMTest 注解参数及注释 - 优化 ServerCoreExceptionProcessService.cs 异常信息输出,增加 errorInfo 字段,优先输出 InnerException 堆栈 - 移除未使用的 using 引用 - 项目版本号升级至 1.1.12

cfb7ea0
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

4 个文件 +16 -11
Modified XFEExtension.NetCore.ServerInteractive.Test/Program.cs +2 -2
@@ -24,7 +24,7 @@ internal class Program
24 24 Console.WriteLine($"请求完成:{e.StatusCode}\t{e.Message}");
25 25 }
26 26
27 //[SMTest("Admin", "123456")]
27 [SMTest("Admin", "1234564")]
28 28 public static async Task Login(string account, string password)
29 29 {
30 30 var result = await xFEClientRequester.Request<UserLoginResult<UserFaceInfo>>("login", account, password);
@@ -46,7 +46,7 @@ internal class Program
46 46 }
47 47 }
48 48
49 [SMTest]
49 //[SMTest]
50 50 public static async Task Test()
51 51 {
52 52 await Parallel.ForEachAsync(Enumerable.Range(0, 100000), async (i, _) =>
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/ServerCoreExceptionProcessService.cs +7 -3
@@ -25,6 +25,9 @@ public class ServerCoreExceptionProcessService : ServerCoreOriginalServiceBase
25 25 {
26 26 var currentException = e.ServerException?.InnerException;
27 27 var errorMessage = e.ServerException?.Message ?? "服务器内部异常";
28 var errorInfo = "服务器内部异常";
29 if (e.ServerException?.InnerException is ServerCoreReturnArgs returnArgs)
30 errorInfo = returnArgs.ReturnMessage;
28 31 for (int i = 0; i < 5; i++)
29 32 {
30 33 if (currentException is null)
@@ -37,9 +40,10 @@ public class ServerCoreExceptionProcessService : ServerCoreOriginalServiceBase
37 40 currentException = currentException.InnerException;
38 41 }
39 42 }
40 Console.Write($"[WARN]【{e.ServerException}】{errorMessage}");
41 if (e.ServerException?.StackTrace is not null)
42 Console.WriteLine($"[TRACE]{e.ServerException?.StackTrace}");
43 Console.WriteLine();
44 Console.WriteLine($"[WARN]【{errorInfo}】{errorMessage}");
45 if (e.ServerException?.InnerException?.StackTrace is not null)
46 Console.WriteLine($"[TRACE]{e.ServerException?.InnerException?.StackTrace}");
43 47 try
44 48 {
45 49 await e.ReturnArgs.CloseWithError(errorMessage, e.StatusCode);
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/ServerExceptionProcessService.cs +1 -2
@@ -1,5 +1,4 @@
1 using XFEExtension.NetCore.FileExtension;
2 using XFEExtension.NetCore.ServerInteractive.Implements.ServerService;
1 using XFEExtension.NetCore.ServerInteractive.Implements.ServerService;
3 2
4 3 namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.ServerService;
5 4
Modified XFEExtension.NetCore.ServerInteractive/XFEExtension.NetCore.ServerInteractive.csproj +6 -4
@@ -5,7 +5,7 @@
5 5 <ImplicitUsings>enable</ImplicitUsings>
6 6 <Nullable>enable</Nullable>
7 7 <GenerateDocumentationFile>True</GenerateDocumentationFile>
8 <Version>1.1.11</Version>
8 <Version>1.1.12</Version>
9 9 <Title>XFEExtension.NetCore.ServerInteractive</Title>
10 10 <RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive</RepositoryUrl>
11 11 <AnalysisLevel>latest</AnalysisLevel>
@@ -21,10 +21,12 @@
21 21 <PackageReleaseNotes>
22 22 ## 调整
23 23
24 优化日志管理逻辑,调整保存与加载流程
24 优化异常处理逻辑并更新项目版本号
25 25
26 本次提交移除了服务器关闭、重启和异常处理时自动保存日志的代码,将日志保存路径的设置提前至初始化阶段,并简化了日志文件加载流程。
27 同步清理了无用命名空间引用,项目版本号升级为1.1.11。
26 - 调整 Program.cs 中 SMTest 注解参数及注释
27 - 优化 ServerCoreExceptionProcessService.cs 异常信息输出,增加 errorInfo 字段,优先输出 InnerException 堆栈
28 - 移除未使用的 using 引用
29 - 项目版本号升级至 1.1.12
28 30
29 31 ## 新增
30 32