获取不到存储空间百分比的时候返回空不报错

This commit is contained in:
lilin 2025-08-18 09:21:09 +08:00
parent 12cd3be1f7
commit f3ea8ebb0d

View File

@ -532,7 +532,8 @@ public class StorageSourceConvertImpl implements StorageSourceConvert {
return df.format(remainingPercentage) + "%";
} catch (Exception e) {
throw new IllegalArgumentException("无法获取磁盘空间: " + e.getMessage());
return null;
//throw new IllegalArgumentException("无法获取磁盘空间: " + e.getMessage());
}
}
//计算空间生育大小
@ -566,7 +567,8 @@ public class StorageSourceConvertImpl implements StorageSourceConvert {
return formatted + "GB";
} catch (Exception e) {
throw new IllegalArgumentException("无法获取磁盘空间: " + e.getMessage());
return null;
//throw new IllegalArgumentException("无法获取磁盘空间: " + e.getMessage());
}
}