Errors
When a program cannot give a value, Garo gives an error instead. This page lists every kind of error, what each one means, and how to recover from the ones that come from data.
What an error looks like
1 ÷ 0An error starts with !, then its kind, then a message. In full, the line above prints !domain: division by zero (§17.3). The kind is a fixed word you can rely on. The message says what went wrong in that case, and often how to fix it. A section number such as §17.3 points into the Garo spec.
A program either gives one value or fails with one error. There are no warnings, and no partial results. When several things are wrong, the first one found is the error.
The kinds at a glance
| Kind | Means | Found |
|---|---|---|
domain | the data has no answer here | while running |
type | the program puts values together wrongly | before the data matters |
syntax | the program cannot be read | while reading |
illegal | the syllable is not on the lattice | while reading the syllable |
unminted | the syllable could exist, but does not | while reading the syllable |
unresolved | the syllable waits on an open design question | while reading the syllable |
deferred | the syllable uses the ranked flow ㅢ, set aside | while reading the syllable |
unimplemented | the spec defines it, this interpreter does not yet | when reached |
The first three are about your program and its data. The next four are the lattice refusing a syllable. The last is a gap in this interpreter.
Errors from data
domain
A domain error means the operation was well formed, but this data has no answer. Division by zero is the classic case:
1 ÷ 0Other domain errors:
- Float arithmetic with no defined result, such as
∞ - ∞or0 × ∞. Garo has no NaN, so these fail instead of producing one. - Two arrays of the same rank but different lengths, paired element by element:
[1, 2] + [1, 2, 3]- A key list whose length differs from the data's:
댇 [`a, `b, `c] [1, 2]- A lookup by key when the keys repeat, since a lookup needs one answer:
앰 `a [`a, `a] [10, 20]- A table whose columns differ in length, or a date that does not exist:
Date [2026, 2, 30]- A position outside an enum: with three labels,
Size 3has no label.
What these share is that the types are fine. Only the lengths or the values are wrong, so the same program would work on other data. That is why domain is the one kind Try catches.
A missing answer is not an error. A position past the end gives `none, and so does arithmetic on an absent value:
[`none, 1] ÷ [0, 1]The `none never meets the 0, so nothing is divided by zero.
Errors in the program
type
A type error means the program combines values in a way no data could make work. The values are the wrong kind for the operation:
닫 [`a, `b]Labels have no sum. Other type errors:
- Two element types that do not convert. Only Int and Float meet; a Bool is not a number, and a Sym is not a Text.
1 + true- Arrays of different ranks paired element by element. A vector and a matrix never line up, whatever their lengths:
[1, 2] + [[1, 2], [3, 4]]- A ragged array, such as
[[1, 2], [3]]. Arrays are rectangular. - A wrong parameter: a negative count, a fill value that is absent, a window of zero. This is a type error even when there is no data to apply it to.
김 (-1) [1]- An open syllable with no function, or with a function of the wrong number of inputs:
다 [1, 2]- A column a table does not have, such as
t.missing. - A keyed-arm literal that does not cover every case, or whose arms give different types:
{ `true ⇒ 0 } false- A function where a value belongs. A line that ends as a block, such as
{x × 2}, has no value to print.
Garo checks an operation's types before it looks at its data. So when one operation has both kinds of mistake, the type error wins:
[true] + [1, 2]The lengths differ, which alone would be a domain error. But a Bool and an Int never add, at any length, so the operation is wrong on every input, and Garo reports that. The check is per operation: a data error in an earlier step, such as (1 ÷ 0) + x, still comes out first. The values and types page explains the order of the checks.
syntax
A syntax error means Garo cannot read the program. Two values side by side are the most common one, since arrays need brackets and commas:
[1, 2] [3, 4]Other syntax errors:
- An unfinished line, such as
1 +, or a missing). - A character Garo does not use, such as
*for multiplication. Write×. - A name that was never bound:
total + 1- A spaced parameter inside a word: write
깃님3, not깃님 3. - A name given twice in a table or a record, or a key given twice in a keyed-arm literal.
- A block with more than two named arguments.
- An
enumwith a lowercase name, a repeated label, or`noneas a label.
The lattice says no
Every syllable is a family, a flow and a final (see the lattice). Most combinations are not operators. When you write one that is not, Garo says which of four reasons applies.
illegal
The syllable is not on the lattice, or its family does not accept its flow. One of its parts has no meaning, or the combination makes no sense:
까 [1]ㄲ is not one of the twelve family consonants. A vowel outside the nine flows, or a final outside the nine finals, does the same. So does a flow its family rejects, such as reduce on single elements:
딛 [1, 2]There is nothing to reduce in one element.
unminted
The syllable is well formed and could have a meaning, but no operator has been made there. Usually another syllable already does the job, and the message names it:
닾 [1, `none, 3]The message reads: "reduce + ㅍ is displaced; sum the present elements with 닫 (닢 x)". Garo keeps one way to say each thing, so 닫 (닢 x) is the way. Some unminted cells are retired operators, and some are empty until a real use earns them.
unresolved
The cell is reserved, but its design is still open. Today one syllable is in this state: the bare shape form 마, which would permute named axes, a design not yet made.
{x}마 [1, 2]deferred
The syllable uses the ranked flow ㅢ. The whole ㅢ row is set aside until a later design decides how ranks are named, so every ㅢ syllable is this error:
듿 [1, 2]unimplemented
The spec defines it, but this interpreter does not do it yet. The most common case is a capitalized name that is not Date, Days, Table, Record or an enum you declared. Your own named functions need the sentence layer, which is not available:
Average [1, 2, 3]A Try result that would hold a table or a record is also unimplemented: this interpreter's Try results hold arrays.
Try: recovering from an error
An operation over a whole array fails if any one element fails:
{1 ÷ x}기 [1, 0, 4]To keep going, wrap the function in ?, called Try. ?F never fails with a domain error. It gives `ok and the result, or `err and the error's kind:
(?{1 ÷ x})기 [1, 0, 4]Each element's failure is now data. A keyed-arm literal takes the result apart, so you choose what a failure becomes:
{ `ok v ⇒ v, `err k ⇒ 0 }기 ((?{1 ÷ x})기 [1, 0, 4])Mind the parentheses. ? applies to the function right after it. In (?{1 ÷ x})기, Try wraps the block, so each element gets its own result. In ?{1 ÷ x}기, Try wraps the whole word, so one failure fails it all:
?{1 ÷ x}기 [1, 0, 4]The kind inside `err is a Sym. You can branch on it, but the set of kinds may grow, so a literal over kinds always needs an else arm:
{ `ok v ⇒ v, `err k ⇒ { `domain ⇒ -1, _ ⇒ -2 } k } ((?{1 ÷ x}) 0)What Try does not catch
Try catches only domain errors: failures that depend on the data. A type or syntax error passes straight through:
(?{x + `a}) 1This is deliberate. A type error means the program is wrong, on every input. Turning it into a value per row would hide a bug as if it were bad data. Fix the program instead. The lattice errors and unimplemented pass through for the same reason.
In SQL terms, Try is close to TRY_CAST, which gives a marker for a bad row instead of failing the whole query. Garo's marker also says why the row failed.