优化异常处理

pull/783/head
648540858 2023-03-17 14:02:16 +08:00
parent c3ce2bc5d0
commit 22a205e8fc
4 changed files with 31 additions and 37 deletions

View File

@ -520,7 +520,7 @@ public class StreamInfo implements Serializable, Cloneable{
try{ try{
instance = (StreamInfo)super.clone(); instance = (StreamInfo)super.clone();
}catch(CloneNotSupportedException e) { }catch(CloneNotSupportedException e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
} }
return instance; return instance;
} }

View File

@ -1,24 +1,16 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; 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.CmdType;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; 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.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; 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.ISIPRequestProcessor;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; 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.SipUtils;
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 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.SIPRequest;
import gov.nist.javax.sip.message.SIPResponse; import gov.nist.javax.sip.message.SIPResponse;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
@ -29,7 +21,9 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; 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.header.ExpiresHeader;
import javax.sip.message.Response; import javax.sip.message.Response;
import java.text.ParseException; import java.text.ParseException;

View File

@ -38,7 +38,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -66,7 +66,7 @@ public class RedisUtil {
try { try {
return redisTemplate.hasKey(key); return redisTemplate.hasKey(key);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -91,7 +91,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -124,7 +124,7 @@ public class RedisUtil {
redisTemplate.opsForValue().set(key, value); redisTemplate.opsForValue().set(key, value);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -148,7 +148,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -226,7 +226,7 @@ public class RedisUtil {
redisTemplate.opsForHash().putAll(key, map); redisTemplate.opsForHash().putAll(key, map);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -249,7 +249,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -269,7 +269,7 @@ public class RedisUtil {
redisTemplate.opsForHash().put(key, item, value); redisTemplate.opsForHash().put(key, item, value);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -293,7 +293,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -365,7 +365,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForSet().members(key); return redisTemplate.opsForSet().members(key);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return null; return null;
} }
} }
@ -383,7 +383,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForSet().isMember(key, value); return redisTemplate.opsForSet().isMember(key, value);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -401,7 +401,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForSet().add(key, values); return redisTemplate.opsForSet().add(key, values);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -424,7 +424,7 @@ public class RedisUtil {
} }
return count; return count;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -441,7 +441,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForSet().size(key); return redisTemplate.opsForSet().size(key);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -459,7 +459,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForSet().remove(key, values); return redisTemplate.opsForSet().remove(key, values);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -625,7 +625,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForList().range(key, start, end); return redisTemplate.opsForList().range(key, start, end);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return null; return null;
} }
} }
@ -642,7 +642,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForList().size(key); return redisTemplate.opsForList().size(key);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -662,7 +662,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForList().index(key, index); return redisTemplate.opsForList().index(key, index);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return null; return null;
} }
} }
@ -681,7 +681,7 @@ public class RedisUtil {
redisTemplate.opsForList().rightPush(key, value); redisTemplate.opsForList().rightPush(key, value);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -704,7 +704,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -723,7 +723,7 @@ public class RedisUtil {
redisTemplate.opsForList().rightPushAll(key, values); redisTemplate.opsForList().rightPushAll(key, values);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -746,7 +746,7 @@ public class RedisUtil {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -766,7 +766,7 @@ public class RedisUtil {
redisTemplate.opsForList().set(key, index, value); redisTemplate.opsForList().set(key, index, value);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return false; return false;
} }
} }
@ -787,7 +787,7 @@ public class RedisUtil {
try { try {
return redisTemplate.opsForList().remove(key, count, value); return redisTemplate.opsForList().remove(key, count, value);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return 0; return 0;
} }
} }
@ -829,7 +829,7 @@ public class RedisUtil {
Set<String> set = redisTemplate.keys(key); Set<String> set = redisTemplate.keys(key);
return new ArrayList<>(set); return new ArrayList<>(set);
} catch (Exception e) { } catch (Exception e) {
logger.error("未处理的异常 ", e); e.printStackTrace();
return null; return null;
} }
} }
@ -854,7 +854,7 @@ public class RedisUtil {
// //关闭cursor // //关闭cursor
// cursor.close(); // cursor.close();
// } catch (Exception e) { // } catch (Exception e) {
// logger.error("未处理的异常 ", e); // e.printStackTrace();
// } // }
// return result; // return result;
// } // }

View File

@ -331,7 +331,7 @@ export default {
return result; return result;
}, },
checkExpires: function() { checkExpires: function() {
if (this.platform.enable && this.platform.expires == "0") { if (this.platform.enable && this.platform.expires === "0") {
this.platform.expires = "300"; this.platform.expires = "300";
} }
}, },