feat(): 增加了字符集异常日志打印
parent
6596edd443
commit
9e18f7a918
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.common.core.text;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
@ -15,6 +16,7 @@ import java.util.Set;
|
|||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@Log4j2
|
||||
public class Convert {
|
||||
/**
|
||||
* 转换为字符串<br>
|
||||
|
@ -687,7 +689,12 @@ public class Convert {
|
|||
* @return 字符串
|
||||
*/
|
||||
public static String str (Object obj, String charsetName) {
|
||||
try {
|
||||
return str(obj, Charset.forName(charsetName));
|
||||
} catch (Exception e) {
|
||||
log.error("字符转换异常:[{}-{}] ——> {}", obj, charsetName, e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue