Errors
An error is a named failure a protocol function can raise. It
has a required message and, optionally, fields.
message
A string with {dotted.path} placeholders that are substituted when the
error is rendered — {self.name} reads the error's own name field. Write a
literal brace by doubling it: {{ and }}.
message is expected on every error.
Fields
After message, an error takes fields exactly like a
struct — typed, optionally optional, with defaults and
docstrings. They carry the data the message placeholders read.
Raising one
A function declares the errors it can raise with ! ErrorName:
This is a bare reference — binding values into the error's fields at the raise site is not part of the language yet.