Error guide
Koskari errors currently use exception classes rather than a stable numeric error code catalog. This page gives the public names you are most likely to see and how to respond to them.
Every class on this page is bound in every module, as is every Python exception type, so each can be raised, caught, and tested by name with no import:
(try (shift k 1)
[[e KoskariContinuationError] (type e).__name__]) ; "KoskariPromptNotFound"
Hierarchy
Exception
KoskariException
NotYetImplemented
KoskariSyntaxError (also SyntaxError)
ReaderError
ReaderSyntaxError
FormatStringSyntaxError
ReaderEOF
LayoutError
CompilerError
SpecialError
SyntaxMatchError
FenceError
ParametersError
UncaughtCompilerError
KoskariContinuationError
KoskariPromptNotFound
KoskariPromptUnreachable
TypeError
KoskariSyncViolation
Compile errors are not SyntaxErrors: [[SyntaxError] ...] catches a
reader error but not a SyntaxMatchError; catch CompilerError.
Reader errors: Koskari could not read the text
Reader errors happen before evaluation starts. They usually mean punctuation, quoting, or layout needs to be fixed.
Error |
What it means |
What to try |
|---|---|---|
|
Base class for reader-phase failures. It subclasses |
Catch this to handle any reader failure in one place. |
|
The reader found invalid syntax, such as mismatched delimiters. |
Count |
|
Input ended while a form was still open. |
Finish the string, list, block, or closing delimiter. |
|
A format string could not be parsed. |
Check the expression inside the format string. |
|
An indentation-based block has the wrong shape. |
Check the |
Example:
( 1 2 ]
This is a reader problem: Koskari cannot turn the text into a form.
Compile errors: Koskari read the form but rejected its shape
Compile errors happen after reading and before runtime evaluation.
Error |
What it means |
What to try |
|---|---|---|
|
Base class for compile-phase failures. |
Look for the form shown in the diagnostic. |
|
A special form has invalid arguments. |
Compare the form with its reference page. |
|
A form matched no arm of a special’s syntax. The diagnostic lists the patterns that special accepts. |
Check argument order, keywords, and required body forms. |
|
A parameter or argument list is malformed: |
Reorder the arguments and give every keyword a value. |
|
A fence block could not be expanded, or the foreign source inside it could not be parsed. |
Check the fence’s options and the embedded source. |
|
An unexpected exception escaped the compiler and was wrapped with the form being compiled. |
Read the chained cause. Report it when the form is valid. |
Example:
(var)
The text is readable, but the var form is missing required pieces.
Runtime errors: evaluation started and something went wrong
Runtime failures include ordinary Python exceptions raised by called Python code and Koskari runtime exceptions.
Error |
What it means |
What to try |
|---|---|---|
|
Base class for Koskari-raised exceptions. |
Read the specific subclass and form details. |
|
A placeholder for a feature that is not implemented yet. |
Use a documented form or report the missing case. |
|
Base class for continuation capture and transfer failures. It is not a |
Read the specific subclass; the two below need different fixes. |
|
A |
Establish one: |
|
A boundary denied the capture ( |
Restructure so the capture does not cross the boundary; adding a delimiter will not help. |
Python exceptions such as |
A called operation failed at runtime. |
Fix the value, missing name, or failing Python call. |
Koskari errors that subclass a Python type
Two Koskari classes inherit from a Python exception type.
Error |
Python base |
What it means |
What to try |
|---|---|---|---|
|
|
A synchronous demand path reached an |
Move the operation into an async-aware path, or stop demanding the call. |
|
|
Read-time or compile-time syntax failure; the base of the reader errors above. |
See the reader table. |
KoskariSyncViolation is defined in the native extension and inherits from
TypeError alone, so an except KoskariException will not catch it; catch it
by its own name or by TypeError. KoskariSyntaxError inherits from both
SyntaxError and KoskariException.
Example:
(/ 1 0)
This is a runtime problem: the form is readable and compilable, but the operation cannot succeed.
Reading diagnostics
When an error is long, use this order:
Read the exception class name.
Read the first message line.
If a source line and caret are shown, fix that location first.
If a form is shown, compare that form to the relevant reference page.
Change one thing and rerun.
See also Errors and debugging for a Python-oriented walkthrough.