feat():修改了报错异常

master
86191 2024-08-06 15:28:03 +08:00
parent fe53184924
commit 98a2b5d44a
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package com.muyu.common.core.text;
import com.muyu.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.math.BigInteger;
@ -15,6 +16,7 @@ import java.util.Set;
*
* @author muyu
*/
@Slf4j
public class Convert {
/**
* <br>
@ -687,7 +689,12 @@ public class Convert {
* @return
*/
public static String str (Object obj, String charsetName) {
return str(obj, Charset.forName(charsetName));
try {
return str(obj, CharsetKit.charset(charsetName));
}catch (Exception exception){
log.info("字符转换异常:[{}-{}] -> {}",obj,charsetName,exception.getMessage(),exception);
throw new RuntimeException(exception);
}
}
/**