Unreachable catch block for SQLException. This exception is never thrown from the try statement body

<span style="font-size:18px;">public boolean deleteAllByUid() {
		try {
			List<MyCircleBean> list = findAllByUid();
			if (list != null) {
				for (MyCircleBean item : list) {
					delete(item);
				}
			}
			return true;
		} catch (SQLException e) {
			e.printStackTrace();
		}

		return false;
	}</span>

这段代码中报了Unreachable catch block for SQLException. This exception is never thrown from the try statement body这个异常


根据提示仔细一想,其实是这里findAllByUid()和这里delete()方法把所有的异常全都捕获了。

所以出现了上面这种错误。

你可能感兴趣的:(Unreachable catch block for SQLException. This exception is never thrown from the try statement body)