Skip to content

Commit e358b77

Browse files
authored
Update error message in writableSegment (#398)
1 parent c06a601 commit e358b77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/common/src/Buffer.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ public class Buffer : Source, Sink {
352352
@PublishedApi
353353
@JvmSynthetic
354354
internal fun writableSegment(minimumCapacity: Int): Segment {
355-
require(minimumCapacity >= 1 && minimumCapacity <= Segment.SIZE) { "unexpected capacity" }
355+
require(minimumCapacity >= 1 && minimumCapacity <= Segment.SIZE) {
356+
"unexpected capacity ($minimumCapacity), should be in range [1, ${Segment.SIZE}]"
357+
}
356358

357359
if (tail == null) {
358360
val result = SegmentPool.take() // Acquire a first segment.

0 commit comments

Comments
 (0)