Error Code Examples
Each file in examples/error-codes/ contains a minimal program that triggers one specific compiler diagnostic. Run any of them with ragul check to see the exact error output.
E001 — Root Guard Failure
Fires when a suffix is applied to a root whose type does not satisfy the suffix's type contract.
program-ours-effect
// ERROR — "hello" is a String; -above requires a Number
result-into "hello"-5-above-it.
result-print-doing.
Output:
ERROR E001 Suffix -felett (-above) expects Number (Szám), but root is String (Szöveg).
WARN W001 Suffix chain crosses type boundary from String (Szöveg) to Number (Szám) without a bridge suffix.
Fix: Use a Number root directly (42-5-above-it.) or convert first with -tonum ("42"-tonum-5-above-it.).
E003 — Parallel Write Conflict
Fires when two independent sentences in a pure (non-effect) scope both write to the same root.
Output:
Fix: Give each write a distinct name, or use an effect scope (-ours-effect) for sequential reassignment.
E004 — Effectful Call from Pure Scope
Fires when an I/O or side-effect suffix is used outside a -ours-effect (-nk-hatás) scope.
Output:
Fix: Wrap the program in an effect scope:
E005 — Unhandled Fallible (vagy) Type
Fires when a vagy (fallible) result is used without first handling the error case.
program-ours-effect
// -tonum returns Number|Error — using the result without handling the error fires E005
n-into "abc"-tonum-doing.
n-print-doing.
Output:
ERROR E005 Root '"abc"' is Number|Error — both cases must be handled.
ERROR E005 Root 'n' is Number|Error — both cases must be handled.
Fix — propagate with -doing-?:
Fix — catch the error:
program-ours-effect
n-into "abc"-tonum-doing-?.
n-print-doing.
-catch
"Could not parse as number"-print-doing.
E006 — Scope Leak
Fires when a root defined inside a child scope is referenced in an outer scope where it does not exist.
calculator-ours-effect
result-into 6-7-mul-it. // 'result' lives inside 'calculator'
result-print-doing.
program-ours-effect
// ERROR — 'result' is defined inside 'calculator', not here
summary-into result-it.
summary-print-doing.
Output:
Fix: Either reference result from inside calculator, or define a scope that returns the value and bind the result in the outer scope.
E007 — Module Not Found
Fires when a -from (-ból) import cannot be resolved to a .ragul file on the module search path.
program-ours-effect
// ERROR — no geometry.ragul exists on the search path
geometry-from.
area-into 10-5-area-calc-it.
area-print-doing.
Output:
Fix: Create geometry.ragul in the same directory as your script, or add its directory to modulok.utvonalak in ragul.config.
E009 — Field Mutation Outside Effect Scope
Planned for v0.3.0. The diagnostic is implemented; OOP / record-update syntax is not yet in the parser. Until then, the equivalent enforcement is E003 (parallel write conflict in a pure scope).
Fires when a field on a data record is mutated from inside a pure scope.
Intended pattern (v0.3.0):
Output (v0.3.0):
Fix: Move the mutation inside a -ours-effect scope, or return a new record with the updated field.
W001 — Type Harmony Warning
Fires when a suffix changes the element type (e.g. String → List) without an explicit bridge suffix. This is a warning, not an error — the program still runs.
program-ours-effect
sentence-into "hello world"-it.
// W001 — -split converts String → List without an explicit bridge
words-into sentence-split-" "-it.
words-print-doing.
Output:
WARN W001 Suffix chain crosses type boundary from String (Szöveg) to List[String (Szöveg)] without a bridge suffix.
Suppressing W001: Set harmonia = "off" in ragul.config to disable harmony checks, or "strict" to promote them to errors.
Running All Examples
See the full error code reference in the Tooling guide.