Sfoglia il codice sorgente

取消同步订单的休眠等待,直接抛出异常

dodo hold 1 anno fa
parent
commit
a1d33600a2
2 ha cambiato i file con 65 aggiunte e 64 eliminazioni
  1. 12 2
      molilian.core/Plus/Alimama/crawler.cs
  2. 53 62
      molilian.core/Plus/Alimama/orders.cs

+ 12 - 2
molilian.core/Plus/Alimama/crawler.cs

@@ -611,13 +611,23 @@ namespace molilian.core
                 var response = client.Request(url);
                 var response = client.Request(url);
 
 
                 var body = response.Body();
                 var body = response.Body();
-                var root = body.Convert2JsonElement();
+                JsonElement root = default;
+                try
+                {
+                    root = body.Convert2JsonElement();
+                }
+                catch (Exception)
+                {
+                    _ = new LoggerLibrary("error", "SaveReportOverview").Info(url, body).SaveAsync();
+
+                    throw new Exception("SaveReportOverview body不是 json格式");
+                } 
 
 
                 int resultCode = root.Read<int>("resultCode", 0);
                 int resultCode = root.Read<int>("resultCode", 0);
                 bool success = root.Read("success", false);
                 bool success = root.Read("success", false);
                 if (!success)
                 if (!success)
                 {
                 {
-                    _ = new LoggerLibrary("report", "error")
+                    _ = new LoggerLibrary("error", "SaveReportOverview")
                         .Info(url, body)
                         .Info(url, body)
                         .SaveAsync();
                         .SaveAsync();
 
 

File diff suppressed because it is too large
+ 53 - 62
molilian.core/Plus/Alimama/orders.cs


Some files were not shown because too many files changed in this diff