XFEExtension.NetCore.ServerInteractive
[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore.ServerInteractive.Test/Program.cs
+1
-1
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/ServerCoreExceptionProcessService.cs
+22
-13
Modified
XFEExtension.NetCore.ServerInteractive/XFEExtension.NetCore.ServerInteractive.csproj
+6
-4
XFEstudio/XFEExtension.NetCore.ServerInteractive
优化异常处理逻辑并更新版本号至1.1.16
- 引入字符串扩展以增强空白判断 - 优化异常输出,仅在必要时打印详细信息 - 项目版本号升级为 1.1.16
f9811fc
代码差异
3 个文件
+29
-18
@@ -24,7 +24,7 @@ internal class Program
24
24
Console.WriteLine($"请求完成:{e.StatusCode}\t{e.Message}");
25
25
}
26
26
27
[SMTest("Admin", "1234564")]
27
[SMTest("Admin", "12345641")]
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);
@@ -1,6 +1,7 @@
1
1
using XFEExtension.NetCore.CyberComm;
2
2
using XFEExtension.NetCore.ServerInteractive.Implements.CoreService;
3
3
using XFEExtension.NetCore.ServerInteractive.Models.ServerModels;
4
using XFEExtension.NetCore.StringExtension;
4
5
5
6
namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
6
7
@@ -25,25 +26,33 @@ public class ServerCoreExceptionProcessService : ServerCoreOriginalServiceBase
25
26
{
26
27
var currentException = e.ServerException?.InnerException;
27
28
var errorMessage = e.ServerException?.Message ?? "服务器内部异常";
28
var errorInfo = "服务器内部异常";
29
var errorInfo = string.Empty;
29
30
if (e.ServerException?.InnerException is ServerCoreReturnArgs returnArgs)
30
31
errorInfo = returnArgs.ReturnMessage;
31
for (int i = 0; i < 5; i++)
32
if (errorInfo.IsNullOrWhiteSpace())
32
33
{
33
if (currentException is null)
34
for (int i = 0; i < 5; i++)
34
35
{
35
break;
36
}
37
else
38
{
39
errorMessage += $":{currentException.Message}";
40
currentException = currentException.InnerException;
36
if (currentException is null)
37
{
38
break;
39
}
40
else
41
{
42
errorMessage += $":{currentException.Message}";
43
currentException = currentException.InnerException;
44
}
41
45
}
46
errorInfo = "服务器内部异常";
47
Console.WriteLine();
48
Console.WriteLine($"[WARN]【{errorInfo}】{errorMessage}");
49
if (e.ServerException?.InnerException?.StackTrace is not null)
50
Console.WriteLine($"[TRACE]{e.ServerException?.InnerException?.StackTrace}");
51
}
52
else
53
{
54
Console.Write($"\t【{errorInfo}】");
42
55
}
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}");
47
56
try
48
57
{
49
58
await e.ReturnArgs.CloseWithError(errorInfo, e.StatusCode);
@@ -5,7 +5,7 @@
5
5
<ImplicitUsings>enable</ImplicitUsings>
6
6
<Nullable>enable</Nullable>
7
7
<GenerateDocumentationFile>True</GenerateDocumentationFile>
8
<Version>1.1.15</Version>
8
<Version>1.1.16</Version>
9
9
<Title>XFEExtension.NetCore.ServerInteractive</Title>
10
10
<RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive</RepositoryUrl>
11
11
<AnalysisLevel>latest</AnalysisLevel>
@@ -20,10 +20,12 @@
20
20
<PackageTags>XFE;Server;服务器;XFEExtension</PackageTags>
21
21
<PackageReleaseNotes>
22
22
## 调整
23
24
优化异常处理逻辑并更新版本号至1.1.16
23
25
24
修复异常时状态码未设置并升级版本号
25
26
在 XFEClientRequester.cs 中补充异常处理时的状态码赋值,确保返回结果准确;同时将项目版本号从 1.1.14 升级到 1.1.15。
26
- 引入字符串扩展以增强空白判断
27
- 优化异常输出,仅在必要时打印详细信息
28
- 项目版本号升级为 1.1.16
27
29
28
30
## 新增
29
31