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 ÷ 0
⇒ !domain: division by zero (§17.3)Try it

An 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

KindMeansFound
domainthe data has no answer herewhile running
typethe program puts values together wronglybefore the data matters
syntaxthe program cannot be readwhile reading
illegalthe syllable is not on the latticewhile reading the syllable
unmintedthe syllable could exist, but does notwhile reading the syllable
unresolvedthe syllable waits on an open design questionwhile reading the syllable
deferredthe syllable uses the ranked flow ㅢ, set asidewhile reading the syllable
unimplementedthe spec defines it, this interpreter does not yetwhen 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 ÷ 0
⇒ !domain: division by zero (§17.3)Try it

Other domain errors:

  • Float arithmetic with no defined result, such as ∞ - ∞ or 0 × ∞. 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]
⇒ !domain: + on shapes [2] and [3]: only a scalar extends implicitly; align other shapes with lift (ㅂ, §3.1)Try it
  • A key list whose length differs from the data's:
댇 [`a, `b, `c] [1, 2]
⇒ !domain: a keyed form needs one key per row of its data (D45.8)Try it
  • A lookup by key when the keys repeat, since a lookup needs one answer:
앰 `a [`a, `a] [10, 20]
⇒ !domain: the key `a appears twice, so a lookup is ambiguous (D50.4)Try it
  • A table whose columns differ in length, or a date that does not exist:
Date [2026, 2, 30]
⇒ !domain: there is no date 2026-2-30Try it
  • A position outside an enum: with three labels, Size 3 has 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]
⇒ [`none, 1.0]Try it

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]
⇒ !type: sum needs numbers, texts or durations; Sym has none (§5.3, D45)Try it

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
⇒ !type: + between Int and Bool: no implicit conversion (D45)Try it
  • 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]]
⇒ !type: + between ranks 1 and 2: only a scalar extends implicitly; align other ranks with lift (ㅂ, §3.1)Try it
  • 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]
⇒ !type: this parameter is one Int, at least 0Try it
  • An open syllable with no function, or with a function of the wrong number of inputs:
다 [1, 2]
⇒ !type: 다 is open: it needs a function operand glued on its left (§3.4, D14)Try it
  • 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
⇒ !type: no arm for `false, and no else arm: the arms must cover Bool (D23.5)Try it
  • 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]
⇒ !type: + between Bool and Int: no implicit conversion (D45)Try it

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]
⇒ !syntax: two values side by side: Garo has no stranding, so write arrays as [a, b]Try it

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
⇒ !syntax: unbound name totalTry it
  • 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 enum with a lowercase name, a repeated label, or `none as 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]
⇒ !illegal: 까 is not on the operator lattice: one of its parts has no meaning (§3, D39)Try it

ㄲ 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]
⇒ !illegal: 딛: §3.2: reduce with ㅣ is invalid (scalars can't reduce)Try it

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]
⇒ !unminted: 닾: D42: reduce + ㅍ is displaced; sum the present elements with 닫 (닢 x)Try it

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]
⇒ !unresolved: 마: D49.5: the bare form 마 permutes named axes, which is §8's designTry it

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]
⇒ !deferred: 듿: §3.2 ⚠6, D35: the ㅢ row is deferred out of v0; no ㅢ syllable may be mintedTry it

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]
⇒ !unimplemented: Average: a named function needs a declaration, a statement (§7)Try it

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]
⇒ !domain: division by zero (§17.3)Try it

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]
⇒ [`ok 1.0, `err `domain, `ok 0.25]Try it

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])
⇒ [1.0, 0.0, 0.25]Try it

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]
⇒ `err `domainTry it

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)
⇒ -1Try it

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}) 1
⇒ !type: + between Int and Sym: no implicit conversion (D45)Try it

This 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.