mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
fixed error handle
This commit is contained in:
1 parent
7bf0906291
commit
adf834a4e9
10 files changed
+31
-67
No files matched your search
@@ -61,7 +61,7 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
Block block= null;
|
||||
try {
|
||||
block = new SelfEncodingBase().selfWireEncode(this.ttl);
|
||||
} catch (EncoderException | BlockException e) {
|
||||
} catch (EncoderException | BlockException | ComponentException e) {
|
||||
throw new PacketException("CPacket.fillDataToFields: "+e.getMessage());
|
||||
}
|
||||
if(block==null){
|
||||
@@ -74,7 +74,7 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
this.minPacket.readOnlyField.clearBlocks();
|
||||
try {
|
||||
block=new SelfEncodingBase().selfWireEncode(this.payload);
|
||||
} catch (EncoderException | BlockException e) {
|
||||
} catch (EncoderException | BlockException | ComponentException e) {
|
||||
throw new PacketException("CPacket.fillDataToFields: "+e.getMessage());
|
||||
}
|
||||
if(block==null){
|
||||
@@ -151,11 +151,7 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
// 指定包类型
|
||||
this.minPacket.packetType=new VlInt(TLV.TlvPacketMINCommon);
|
||||
|
||||
try {
|
||||
return this.minPacket.wireEncode(encoder);
|
||||
} catch (EncoderException e) {
|
||||
throw new PacketException("CPacket.wireEncode: "+e.getMessage());
|
||||
}
|
||||
return this.minPacket.wireEncode(encoder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,12 +161,8 @@ public class CPacket implements InteractWithField, IEncodingAble {
|
||||
*/
|
||||
@Override
|
||||
public boolean wireDecode(Block block) throws PacketException {
|
||||
try {
|
||||
if(!this.minPacket.wireDecode(block)){
|
||||
return false;
|
||||
}
|
||||
} catch (VlIntException e) {
|
||||
throw new PacketException("CPacket.wireDecode: "+e.getMessage());
|
||||
if(!this.minPacket.wireDecode(block)){
|
||||
return false;
|
||||
}
|
||||
return this.extraDataFromFields();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user