Polishing contribution

Closes gh-35625
This commit is contained in:
rstoyanchev
2025-10-14 16:49:10 +01:00
parent ba2bb08589
commit 05814f7a42
2 changed files with 9 additions and 1 deletions
@@ -31,10 +31,17 @@ package org.springframework.core.io.buffer;
public class DataBufferLimitException extends IllegalStateException {
/**
* Create an instance with the given message.
*/
public DataBufferLimitException(String message) {
super(message);
}
/**
* Create an instance with a message and a cause, e.g. {@link OutOfMemoryError}.
* @since 6.2.12
*/
public DataBufferLimitException(String message, Throwable cause) {
super(message, cause);
}
@@ -383,7 +383,8 @@ public class NettyDataBuffer implements PooledDataBuffer {
return this.byteBuf.toString();
}
catch (OutOfMemoryError ex) {
throw new DataBufferLimitException("Failed to convert data buffer to string: " + ex.getMessage(), ex);
throw new DataBufferLimitException(
"Failed to convert data buffer to string: " + ex.getMessage(), ex);
}
}