fix:attachedVerifyAndGetAllHsm throw exception with error code instead of return null

This commit is contained in:
cheney 2025-08-15 14:04:38 +08:00
parent e299efe782
commit c516397ad6

View File

@ -12411,10 +12411,8 @@ public class SydApi4j implements SydApi {
RetWrap retWrap = attachedVerifyAndGetAll(sign); RetWrap retWrap = attachedVerifyAndGetAll(sign);
if (retWrap == null) { if (retWrap == null) {
return null; return null;
return (byte[]) retWrap.get("oData");
} }
return (String) retWrap.get("oData"); return (byte[]) retWrap.get("oData");
} }
/** /**
@ -12491,7 +12489,10 @@ public class SydApi4j implements SydApi {
PacketSection error = (PacketSection) ret.get("error"); PacketSection error = (PacketSection) ret.get("error");
byte[] be = error.getBytes(); byte[] be = error.getBytes();
if ((0 != (be[0] ^ be[1]))) { if ((0 != (be[0] ^ be[1]))) {
return null; SydApiException e = new SydApiException(error.getInfo(), error.autoInt());
// println("验签失败=" + e.toString());
// return null;
throw e;
} }
PacketSection info = (PacketSection) ret.get("info"); PacketSection info = (PacketSection) ret.get("info");