Skip to content

buffer capacity error

Mojo function 🡭

def buffer_capacity_error(capacity: Int, max_capacity: Int = 0, growth_hint: Bool = False, at_max: Bool = False) -> String

Build a single “line exceeds buffer” message for use by LineIterator and parser/utils.

Args:

  • capacity (Int): Current buffer capacity in bytes.
  • max_capacity (Int): Maximum buffer capacity when growth is enabled (0 if N/A).
  • growth_hint (Bool): If True, append hint to enable buffer_growth or use larger buffer_capacity.
  • at_max (Bool): If True and max_capacity > 0, message is about exceeding max capacity.

Returns:

String: A string suitable for raise Error(…).