Parse error

primitive TooLarge
  """Request line or headers exceed the configured size limit."""
  fun string(): String iso^ => "TooLarge".clone()

primitive UnknownMethod
  """HTTP method string not recognized."""
  fun string(): String iso^ => "UnknownMethod".clone()

primitive InvalidURI
  """
  Request URI is invalid.

  Raised when the URI is empty, contains control characters, or fails
  RFC 3986 structural parsing in the connection layer (e.g., invalid
  authority in CONNECT targets).
  """
  fun string(): String iso^ => "InvalidURI".clone()

primitive InvalidVersion
  """HTTP version is not HTTP/1.0 or HTTP/1.1."""
  fun string(): String iso^ => "InvalidVersion".clone()

primitive MalformedHeaders
  """Header syntax is invalid (missing colon, obs-fold continuation line)."""
  fun string(): String iso^ => "MalformedHeaders".clone()

primitive InvalidContentLength
  """Content-Length is non-numeric, negative, or has conflicting values."""
  fun string(): String iso^ => "InvalidContentLength".clone()

primitive InvalidChunk
  """Chunked transfer encoding error: bad chunk size or missing CRLF."""
  fun string(): String iso^ => "InvalidChunk".clone()

primitive BodyTooLarge
  """Request body exceeds the configured maximum body size."""
  fun string(): String iso^ => "BodyTooLarge".clone()

type ParseError is
  (TooLarge | UnknownMethod | InvalidURI | InvalidVersion | MalformedHeaders
  | InvalidContentLength | InvalidChunk | BodyTooLarge)
  """Parse error encountered during HTTP request parsing."""