diff --git a/common/src/main/java/org/apache/uniffle/common/netty/buffer/FileSegmentManagedBuffer.java b/common/src/main/java/org/apache/uniffle/common/netty/buffer/FileSegmentManagedBuffer.java index a83492f792..c95e91ae7b 100644 --- a/common/src/main/java/org/apache/uniffle/common/netty/buffer/FileSegmentManagedBuffer.java +++ b/common/src/main/java/org/apache/uniffle/common/netty/buffer/FileSegmentManagedBuffer.java @@ -74,11 +74,15 @@ public ByteBuffer nioByteBuffer() { buf.flip(); return buf; } catch (IOException e) { - String errorMessage = "Error in reading " + this; + String fileName = file.getAbsolutePath(); + String errorMessage = + String.format( + "Errors on reading localfile data with offset[%s] length[%s] from [%s]. ", + offset, length, fileName); try { if (channel != null) { long size = channel.size(); - errorMessage = "Error in reading " + this + " (actual file length " + size + ")"; + errorMessage += String.format("The actual file length: %s", size); } } catch (IOException ignored) { // ignore @@ -107,7 +111,7 @@ public Object convertToNetty() { try { fileChannel = FileChannel.open(file.toPath(), StandardOpenOption.READ); } catch (IOException e) { - throw new RssException("Error in reading " + file); + throw new RssException("Errors on reading " + file.getAbsolutePath(), e); } return new DefaultFileRegion(fileChannel, offset, length); }