mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修改异常包装策略:运行时异常不包装,只包装非运行时异常
This commit is contained in:
@@ -12,16 +12,11 @@
|
||||
|
||||
package org.dromara.hutool.swing.clipboard;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.exception.ExceptionUtil;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
import java.awt.datatransfer.ClipboardOwner;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.awt.datatransfer.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -82,7 +77,7 @@ public class ClipboardUtil {
|
||||
try {
|
||||
return content.getTransferData(flavor);
|
||||
} catch (final UnsupportedFlavorException | IOException e) {
|
||||
throw new HutoolException(e);
|
||||
throw ExceptionUtil.wrapRuntime(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.swing.img;
|
||||
|
||||
import org.dromara.hutool.core.exception.ExceptionUtil;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.io.IORuntimeException;
|
||||
|
||||
@@ -76,7 +77,7 @@ public class FontUtil {
|
||||
try {
|
||||
return Font.createFont(Font.TYPE1_FONT, fontFile);
|
||||
} catch (final Exception e1) {
|
||||
throw new HutoolException(e);
|
||||
throw ExceptionUtil.wrapRuntime(e);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
throw new IORuntimeException(e);
|
||||
@@ -98,7 +99,7 @@ public class FontUtil {
|
||||
try {
|
||||
return Font.createFont(Font.TYPE1_FONT, fontStream);
|
||||
} catch (final Exception e1) {
|
||||
throw new HutoolException(e1);
|
||||
throw ExceptionUtil.wrapRuntime(e1);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
throw new IORuntimeException(e);
|
||||
|
@@ -47,7 +47,7 @@ public class ImgMetaUtil {
|
||||
} catch (final ImageProcessingException e) {
|
||||
throw new HutoolException(e);
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new IORuntimeException(e);
|
||||
}
|
||||
return getOrientation(metadata);
|
||||
}
|
||||
|
Reference in New Issue
Block a user