Skip to content
Playground(another site)

bynk.event.bad_params

Error An on event handler declared the wrong number of parameters, or a second parameter whose type is not EventEnvelope — it takes the event payload and, optionally, the runtime envelope.

An on event handler takes the event payload and, optionally, a second parameter of type EventEnvelope, which carries the emission's metadata: its event id, publisher, time and schema version. Any other count, or any other type in second place, has nothing to receive it. Remove the extra parameter or type it EventEnvelope. A wrong first parameter is bynk.event.handler_param_type_mismatch.

Example

consumes bynk
event Paid = { id: String }
service onPaid from Events(Paid) {
on event(e: Paid, env: String) -> Effect[()] { // ✗ the second parameter must be `EventEnvelope`
on event(e: Paid, env: EventEnvelope) -> Effect[()] { // ✓

In the Book

See also

  • Every code in its category, Events, on the diagnostic index.
  • bynk explain bynk.event.bad_params shows the same from the installed toolchain, without a network.