failure.invalid_outside_construction
Catch-all for rules is used on something that is not a construction.
Area 4, Failures; not declinable; the next step is usually the agent's.
invalid: covers only a construction's rules, never another call's
failures or a write's conditions:
type Note = Text {}type NoteRefused = Failure { kind: FailureKind.rejected}type NoteInvalid = Failure { kind: FailureKind.invalid_value}action check_note(note: Note) fails NoteRefused -> Note { if (note == "") { reject NoteRefused } return note}action save_note(note: Note) fails NoteRefused, NoteInvalid -> Note { return attempt check_note(note) { invalid: NoteInvalid }}
error check_note(...) isn't a construction, so invalid: covers nothing
--> main.jadpo:20:9
|20 | invalid: NoteInvalid | ^^^^^^^ not a construction
- reason
check_note(...)fails with the failures itsfailslist names;invalid:is the catch-all only for the rules a construction's value can break, never for another call's failures.- next
- Remove
invalid: ...;attemptpassescheck_note(...)'s failures on, andmatchturns one into another (agent) - rule
- failure.
invalid_ outside_ construction - help
- https://jadpo.
dev/docs/errors/failure. invalid_ outside_ construction
Markdown for agents: /docs/errors/failure.invalid_outside_construction.md.Built from Jadpo main at aee2e8f.