Browse Source

添加接口返回异常数据ID

callm 4 days ago
parent
commit
51f591c25f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      UAS_MES_HYSX/PublicMethod/HttpServer.cs

+ 4 - 2
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -1102,9 +1102,10 @@ namespace UAS_MES_NEW.PublicMethod
                 {
                     clientSocket.Connect(new IPEndPoint(ip, SN_SERVICE_PORT));
                 }
-                catch
+                catch(Exception ex)
                 {
                     nRet = -13;
+                    dh.ExecuteSql("insert into getdataerror(id,err,datetime)values(getdataerror_seq.nextval,'"+ex.Message+ex.StackTrace+"',sysdate)", "insert");
                     break;
                 }
                 try
@@ -1118,9 +1119,10 @@ namespace UAS_MES_NEW.PublicMethod
                     Array.Copy(bytJson, 0, bytBuf, FACT_DATA_HEAD.MY_LEN, bytJson.Length);
                     clientSocket.Send(bytBuf);
                 }
-                catch
+                catch(Exception ex)
                 {
                     nRet = -12;
+                    dh.ExecuteSql("insert into getdataerror(id,err,datetime)values(getdataerror_seq.nextval,'" + ex.Message + ex.StackTrace + "',sysdate)", "insert");
                     break;
                 }
                 //判定接口回传的flag和本地传过去的是否一致