?? Error Reference

Common errors and how to fix them

Syntax Errors

ParseError: Unexpected token

What It Means

The parser encountered something unexpected. Usually a typo or missing punctuation.

Example

ayanmo x = 5
Irosu.fo(x)  // Error: expected ';'
? Fix
ayanmo x = 5;
Irosu.fo(x);

ParseError: Unterminated string

What It Means

A string literal wasn't closed with a matching quote.

Example

ayanmo msg = "Hello world;  // Missing closing quote
? Fix
ayanmo msg = "Hello world";

Runtime Errors

NameError: Undefined variable 'x'

What It Means

You're using a variable that hasn't been declared.

Example

Irosu.fo(count);  // Error: count not defined
? Fix
ayanmo count = 0;
Irosu.fo(count);

TypeError: Invalid operands for '+'

What It Means

You're trying to add incompatible types.

Example

ayanmo result = [1, 2] + 3;  // Can't add list and number
? Fix
// Use Ogunda.push to add to list
ayanmo result = Ogunda.push([1, 2], 3);  // [1, 2, 3]

DivisionByZero: Cannot divide by zero

What It Means

Mathematical division by zero.

Example

ayanmo result = 10 / 0;  // Error!
? Fix
ayanmo divisor = get_divisor();
ti (divisor != 0) {
    ayanmo result = 10 / divisor;
} bib?k? {
    Irosu.fo("Cannot divide by zero");
}

IndexError: Index out of bounds

What It Means

You're accessing a list index that doesn't exist.

Example

ayanmo items = [1, 2, 3];
ayanmo x = Ogunda.get(items, 10);  // Only indices 0-2 exist
? Fix
ayanmo items = [1, 2, 3];
ti (10 < Ogunda.len(items)) {
    ayanmo x = Ogunda.get(items, 10);
} bib?k? {
    Irosu.fo("Index out of range");
}

Domain Errors

FunctionNotFound: Unknown method 'xyz'

What It Means

You're calling a method that doesn't exist on the domain.

Example

Irosu.write("hello");  // No such method
? Fix
Irosu.fo("hello");  // Use correct method name
// Or for files:
Odi.write("file.txt", "hello");

IOError: File not found

What It Means

Trying to read a file that doesn't exist.

Example

ayanmo data = Odi.read("missing.txt");
? Fix
// Check if file exists first
ti (Odi.exists("missing.txt")) {
    ayanmo data = Odi.read("missing.txt");
} bib?k? {
    Irosu.fo("File not found");
}

Assertion Errors

TabooViolation: Assertion failed

What It Means

An ewo (taboo/assertion) condition was false.

Example

ayanmo age = -5;
ewo age >= 0, "Age cannot be negative";  // PANIC!
? Fix
// Validate data before asserting
ayanmo age = get_age();
ti (age < 0) {
    ayanmo age = 0;  // Set default
}
ewo age >= 0, "Age cannot be negative";  // Now safe

Handling Errors Gracefully

Use Okanran (Error Handling domain) for recoverable errors:

// Try an operation that might fail
ayanmo result = Okanran.try(|| {
    padap? Odi.read("config.txt");
});

// Check if it's an error
ti (Okanran.is_error(result)) {
    Irosu.fo("Could not read config, using defaults");
    ayanmo result = default_config();
}

// Or use unwrap_or for default value
ayanmo data = Okanran.unwrap_or(
    Okanran.try(|| Odi.read("config.txt")),
    "default value"
);