E1012: expected request handler or initial clause
Generated from rellum-diagnostics/src/db.rs.
Explanation
A request binding body may contain only on handlers and an optional initial => clause. Other tokens inside the indented request body are not part of request syntax.
Common causes
- placing a graph or effect binding inside a request body
- misspelling
onorinitial - forgetting to dedent after the request body
Canonical fixes
- write an on handler or initial clause
Before:
value ~ request env!("NAME")
some(v) => v
After:
value ~ request env!("NAME")
on some(v) => v
- dedent following top-level bindings out of the request body
Code example
value ~ request env!("NAME")
some(v) => v