From 439d05654176664111063362ac5c98c772910faa Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期四, 12 九月 2024 12:05:01 +0800
Subject: [PATCH] 异常信息优化
---
HDL_ON/DAL/Server/HttpUtil.cs | 4 +-
.idea/workspace.xml | 47 +++++++++++++++++++++++
HDL_ON/Common/AliyunLog/AliyunLogClient.cs | 5 +-
HDL_ON/UI/MainPage.cs | 2
HDL-ON_iOS/AppDelegate.cs | 4 +-
5 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..cb465dc
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="AutoImportSettings">
+ <option name="autoReloadType" value="NONE" />
+ </component>
+ <component name="ChangeListManager">
+ <list default="true" id="cf0246ae-9d48-4043-85a6-ed222e82c849" name="Changes" comment="">
+ <change beforePath="$PROJECT_DIR$/HDL-ON_iOS/AppDelegate.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL-ON_iOS/AppDelegate.cs" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/HDL_ON/Common/AliyunLog/AliyunLogClient.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/Common/AliyunLog/AliyunLogClient.cs" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/HDL_ON/DAL/Server/HttpUtil.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/DAL/Server/HttpUtil.cs" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/HDL_ON/UI/MainPage.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/UI/MainPage.cs" afterDir="false" />
+ </list>
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="Git.Settings">
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+ </component>
+ <component name="ProjectId" id="2lwzDA5wL1ox0Tq2CH7Wy9DYWWF" />
+ <component name="ProjectViewState">
+ <option name="hideEmptyMiddlePackages" value="true" />
+ <option name="showLibraryContents" value="true" />
+ </component>
+ <component name="PropertiesComponent"><![CDATA[{
+ "keyToString": {
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.cidr.known.project.marker": "true",
+ "cidr.known.project.marker": "true",
+ "dart.analysis.tool.window.visible": "false",
+ "last_opened_file_path": "/Users/kaede/Desktop/Projcect/OnPro"
+ }
+}]]></component>
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="cf0246ae-9d48-4043-85a6-ed222e82c849" name="Changes" comment="" />
+ <created>1726105805372</created>
+ <option name="number" value="Default" />
+ <option name="presentableId" value="Default" />
+ <updated>1726105805372</updated>
+ </task>
+ <servers />
+ </component>
+</project>
\ No newline at end of file
diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs
index 737cce7..5e308c5 100644
--- a/HDL-ON_iOS/AppDelegate.cs
+++ b/HDL-ON_iOS/AppDelegate.cs
@@ -271,14 +271,14 @@
AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
if(e.ExceptionObject is Exception exception)
{
- MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "\r\nStackTrace: " + exception.StackTrace);
+ MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "StackTrace: " + exception.StackTrace);
}
};
TaskScheduler.UnobservedTaskException += (sender, e) => {
if (e.Exception is Exception exception)
{
- MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "\r\nStackTrace: " + exception.StackTrace);
+ MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "StackTrace: " + exception.StackTrace);
}
};
#endregion
diff --git a/HDL_ON/Common/AliyunLog/AliyunLogClient.cs b/HDL_ON/Common/AliyunLog/AliyunLogClient.cs
index 02c0336..c73b943 100644
--- a/HDL_ON/Common/AliyunLog/AliyunLogClient.cs
+++ b/HDL_ON/Common/AliyunLog/AliyunLogClient.cs
@@ -128,10 +128,11 @@
Contents = new Dictionary<string, string>
{
{"id", DateTime.Now.Ticks.ToString()},
- {"homeid", Entity.DB_ResidenceData.Instance.CurrentRegion.id},
+ {"userAccount", UserInfo.Current.AccountString},
{"userid", UserInfo.Current.ID},
{"userName", UserInfo.Current.userName},
- {"server", DAL.Server.HttpUtil.GlobalRequestHttpsHost},
+ {"homeid", Entity.DB_ResidenceData.Instance.CurrentRegion.id},
+ {"server", Entity.DB_ResidenceData.Instance.CurrentRegion.regionUrl},
{"message", msg},
}
}
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index bac48c5..812e1fb 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -251,7 +251,7 @@
}
else
{
- HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content);
+ MainPage.Log("Error", $"鎺ュ彛寮傚父:{requestFullUrl} \r\n" + response.Content);
if(response.Content!= null)
{
try
@@ -270,7 +270,7 @@
}
catch (Exception ex)
{
- HDL_ON.Utlis.WriteLine(ex.Message);
+ MainPage.Log("Error", $"鎺ュ彛寮傚父x锛歿ex.StackTrace}");
return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) };
}
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 689a15c..af44941 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -215,7 +215,7 @@
}
catch (Exception ex)
{
- Log("root erorr : " + ex.Message);
+ Log("Error", "root erorr : " + ex.StackTrace);
}
finally
{
--
Gitblit v1.8.0