From 7b34a626f1e0d8db378ff877429464c008b42bd3 Mon Sep 17 00:00:00 2001 From: yhj <1836460075@qq.com> Date: 星期二, 20 五月 2025 13:27:46 +0800 Subject: [PATCH] 1 --- gdbg/gdbg/Controllers/PrintController.cs | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/gdbg/gdbg/Controllers/PrintController.cs b/gdbg/gdbg/Controllers/PrintController.cs index 3948f86..ee526ec 100644 --- a/gdbg/gdbg/Controllers/PrintController.cs +++ b/gdbg/gdbg/Controllers/PrintController.cs @@ -99,7 +99,7 @@ } - private static string ExtractErrorMessage(string oracleMessage) + /* private static string ExtractErrorMessage(string oracleMessage) { // 鍖归厤 "ORA-20002:" 鍚庣殑鍏蜂綋閿欒淇℃伅 string pattern = @"ORA-20002:.*?:\s(.*?)(\n|$)"; @@ -112,8 +112,26 @@ // 濡傛灉鏃犳硶鍖归厤锛屽垯杩斿洖瀹屾暣閿欒淇℃伅 return oracleMessage; + }*/ + private static string ExtractErrorMessage(string oracleMessage) + { + // 鍖归厤澶氫釜 ORA-20002: 鍚庣殑娈佃惤锛屾彁鍙栨渶鍚庝竴涓� + var matches = System.Text.RegularExpressions.Regex.Matches( + oracleMessage, + @"ORA-20002:(.*?)(?=ORA-\d{5}:|$)" + ); + + if (matches.Count > 0) + { + // 鎻愬彇鏈�鍚庝竴涓尮閰嶉」锛屽幓闄ゆ崲琛屽拰澶氫綑绌烘牸 + return matches[matches.Count - 1].Groups[1].Value.Trim(); + } + + // 榛樿杩斿洖鍘熷閿欒 + return oracleMessage; } + } } -- Gitblit v1.9.3