From 22a205e8fc77feb02d70b01329886c6dc9261516 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 17 三月 2023 14:02:16 +0800
Subject: [PATCH] 优化异常处理

---
 web_src/src/components/dialog/platformEdit.vue                                                         |    2 
 src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java                                             |    2 
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java |   12 +----
 src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java                                         |   52 +++++++++++++-------------
 4 files changed, 31 insertions(+), 37 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
index 42ff5ba..8311745 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
@@ -520,7 +520,7 @@
         try{
             instance = (StreamInfo)super.clone();
         }catch(CloneNotSupportedException e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
         }
         return instance;
     }
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
index 52a0f5d..4ff4e98 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
@@ -1,24 +1,16 @@
 package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
 
-import com.genersoft.iot.vmp.common.VideoManagerConstants;
-import com.genersoft.iot.vmp.conf.DynamicTask;
-import com.genersoft.iot.vmp.conf.UserSetting;
 import com.genersoft.iot.vmp.gb28181.bean.CmdType;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
 import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
-import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask;
 import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
 import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
-import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
-import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
 import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
 import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
 import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
 import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
-import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
-import gov.nist.javax.sip.SipProviderImpl;
 import gov.nist.javax.sip.message.SIPRequest;
 import gov.nist.javax.sip.message.SIPResponse;
 import org.dom4j.DocumentException;
@@ -29,7 +21,9 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import javax.sip.*;
+import javax.sip.InvalidArgumentException;
+import javax.sip.RequestEvent;
+import javax.sip.SipException;
 import javax.sip.header.ExpiresHeader;
 import javax.sip.message.Response;
 import java.text.ParseException;
diff --git a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
index d8270f1..e54ed53 100644
--- a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
@@ -38,7 +38,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -66,7 +66,7 @@
         try {
             return redisTemplate.hasKey(key);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -91,7 +91,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -124,7 +124,7 @@
             redisTemplate.opsForValue().set(key, value);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -148,7 +148,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -226,7 +226,7 @@
             redisTemplate.opsForHash().putAll(key, map);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -249,7 +249,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -269,7 +269,7 @@
             redisTemplate.opsForHash().put(key, item, value);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -293,7 +293,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -365,7 +365,7 @@
         try {
             return redisTemplate.opsForSet().members(key);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return null;
         }
     }
@@ -383,7 +383,7 @@
         try {
             return redisTemplate.opsForSet().isMember(key, value);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -401,7 +401,7 @@
         try {
             return redisTemplate.opsForSet().add(key, values);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -424,7 +424,7 @@
             }
             return count;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -441,7 +441,7 @@
         try {
             return redisTemplate.opsForSet().size(key);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -459,7 +459,7 @@
         try {
             return redisTemplate.opsForSet().remove(key, values);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -625,7 +625,7 @@
         try {
             return redisTemplate.opsForList().range(key, start, end);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return null;
         }
     }
@@ -642,7 +642,7 @@
         try {
             return redisTemplate.opsForList().size(key);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -662,7 +662,7 @@
         try {
             return redisTemplate.opsForList().index(key, index);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return null;
         }
     }
@@ -681,7 +681,7 @@
             redisTemplate.opsForList().rightPush(key, value);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -704,7 +704,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -723,7 +723,7 @@
             redisTemplate.opsForList().rightPushAll(key, values);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -746,7 +746,7 @@
             }
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -766,7 +766,7 @@
             redisTemplate.opsForList().set(key, index, value);
             return true;
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return false;
         }
     }
@@ -787,7 +787,7 @@
         try {
             return redisTemplate.opsForList().remove(key, count, value);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return 0;
         }
     }
@@ -829,7 +829,7 @@
             Set<String> set = redisTemplate.keys(key);
             return new ArrayList<>(set);
         } catch (Exception e) {
-            logger.error("鏈鐞嗙殑寮傚父 ", e);
+            e.printStackTrace();
             return null;
         }
     }
@@ -854,7 +854,7 @@
 //            //鍏抽棴cursor
 //            cursor.close();
 //        } catch (Exception e) {
-//            logger.error("鏈鐞嗙殑寮傚父 ", e);
+//            e.printStackTrace();
 //        }
 //        return result;
 //    }
diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue
index 0298ee7..2a41e6a 100644
--- a/web_src/src/components/dialog/platformEdit.vue
+++ b/web_src/src/components/dialog/platformEdit.vue
@@ -331,7 +331,7 @@
       return result;
     },
     checkExpires: function() {
-      if (this.platform.enable && this.platform.expires == "0") {
+      if (this.platform.enable && this.platform.expires === "0") {
         this.platform.expires = "300";
       }
     },

--
Gitblit v1.8.0