Skip to content
Playground(another site)

bynk.http.cookie_field_not_cookie_record

Error A typed cookie write names a record that is not the cookies record of an on http handler in this unit.

A typed cookie write is named and encoded as its record's decoder reads it, so the record must be the cookies parameter of an on http handler in this unit: that decoder is what the write agrees with. For a cookie in no record, write an untyped Cookie { name, value }.

Example

type Other = { theme: Theme = Light }
Ok("x").withCookie(Other.theme.cookie(Dark)) // ✗ no handler decodes `Other` as `cookies`
Ok("x").withCookie(Prefs.theme.cookie(Dark)) // ✓ `Prefs` is a handler's `cookies` record

In the Book

See also

  • The grammar rule it governs: http_handler.
  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.cookie_field_not_cookie_record shows the same from the installed toolchain, without a network.