Skip to content

Error Handling Examples

EasyLang provides clean, friendly error messages with caret ^ pointers.


Undefined Variable

so print x

Error

RuntimeError: Undefined variable 'x'
    1| so print x
              ^

Type Error

we let x = "hi" plus 10

Error:

RuntimeError: Unsupported operand types for plus: string and number

Module Error

bring "missing.elangh" as m

Error:

RuntimeError: Module file 'missing.elangh' not found.

Incorrect Function Call

we let x = 10 x()

Error:

RuntimeError: Cannot call non-function value

Summary

The error system shows:

  • error type
  • file + line
  • highlighted position