Error Codes Reference
Complete reference for PriyoScript syntax, compile, runtime, and engine error codes.
Theory
Error codes are stable identifiers that map failures to specific language/runtime rules. They make debugging faster because you can search by exact code instead of guessing from a generic message.
Stages and Categories
Error stages
| Stage | Meaning |
|---|---|
syntax | Source parsing/grammar failure |
compile | AST-to-bytecode generation failure |
runtime | Failure during program execution |
core | Internal engine-level failure |
Error categories
| Category | Meaning |
|---|---|
user | Error caused by program/code usage |
engine | Internal runtime/compiler failure |
CLI Commands
monalisa -errors
monalisa -explain <ERROR_CODE>Diagnostics Output Format (What You Will See)
When PriyoScript prints an error now, it includes a richer context block to help you locate issues faster:
TypeandCategory(user vs engine)Phase(parse/compile/vm)Contextwith line numbers and a caret span- Module import hints like
Import sourceandTried paths
Example output (shape only, values vary by error):
So Rude - The requested module could not be loaded.
FYI (Tip): Use `./`, `../`, or `/` imports; PriyoScript also tries `path.priyo` and `path/index.priyo`. Ensure module starts with `lisaaBox { ... }` and avoid cyclic imports.
Code: PRUN-110
Type: PriyoRuntimeError
Stage: runtime
Category: user
Phase: vm
Location: /project/examples/modules/main.priyo:3:3
Context:
2 | monalisa {
> 3 | lisaaBring "./college.priyoo": college
| ^^^^^^^^^^^^^^^^^^^^^
4 | }
Import source: ./college.priyoo
Tried paths: /project/examples/modules/college.priyoo, /project/examples/modules/college.priyoo.priyo, /project/examples/modules/college.priyoo/index.priyo
Docs: https://priyyoscript.vercel.app/docs/stable/reference/errors-reference#prun-110Complete Error Code Table
| Code | Stage | Category | Meaning |
|---|---|---|---|
PSYN-001 | syntax | user | Parse failed |
PSYN-002 | syntax | user | Illegal token / unexpected token |
PSYN-003 | syntax | user | Reserved/forbidden word usage |
PSYN-004 | syntax | user | prakritiPause used outside async function |
PCMP-001 | compile | user | Compile failed |
PRUN-000 | runtime | user | Generic runtime failure |
PRUN-101 | runtime | user | Undefined variable |
PRUN-102 | runtime | user | Constant reassignment |
PRUN-103 | runtime | user | Division by zero |
PRUN-104 | runtime | user | Unknown class |
PRUN-105 | runtime | user | Unknown callable |
PRUN-106 | runtime | user | Property access/assignment error |
PRUN-107 | runtime | user | Argument mismatch |
PRUN-108 | runtime | user | Invalid input |
PRUN-109 | runtime | user | Unknown package |
PRUN-110 | runtime | user | Unknown module |
PRUN-111 | runtime | user | File not found |
PRUN-112 | runtime | user | Task cancelled |
PENG-001 | core | engine | Internal engine error |
Syntax Errors
PSYN-001 Parse failed
Incorrect
monalisa {
priyoTell("hello"
}Correct
monalisa {
priyoTell("hello")
}PSYN-002 Illegal token
Incorrect
monalisa {
prakritiIff (priyoTrue) {
priyoTell("ok")
}
}Correct
monalisa {
prakritiIf (priyoTrue) {
priyoTell("ok")
}
}PSYN-003 Reserved word usage
Incorrect
monalisa {
priyoKeep class = 10
}PSYN-004 Await outside async function
Wrong
monalisa {
lisaaTask total(a, b) {
priyoGiveBack prakritiPause (a + b)
}
}Correct
monalisa {
prakritiWait lisaaTask total(a, b) {
priyoGiveBack prakritiPause (a + b)
}
}Correct
monalisa {
priyoKeep classCount = 10
}Compile Error
PCMP-001 Compile failed
Incorrect
monalisa {
priyoGiveBack 10
}Correct
monalisa {
lisaaTask getValue() {
priyoGiveBack 10
}
priyoTell(getValue())
}Runtime Errors
PRUN-000 Generic runtime failure
Incorrect
monalisa {
priyoKeep x = priyoEmpty.foo
}Correct
monalisa {
priyoKeep obj = { foo: 10 }
priyoTell(obj.foo)
}PRUN-101 Undefined variable
Incorrect
monalisa {
priyoTell(total)
}Correct
monalisa {
priyoKeep total = 10
priyoTell(total)
}PRUN-102 Const reassignment
Incorrect
monalisa {
priyoPromise x = 1
x = 2
}Correct
monalisa {
priyoChange x = 1
x = 2
}PRUN-103 Division by zero
Incorrect
monalisa {
priyoTell(10 / 0)
}Correct
monalisa {
lisaaTask safeDiv(a, b) {
prakritiIf (b == 0) { priyoGiveBack priyoEmpty }
priyoGiveBack a / b
}
priyoTell(safeDiv(10, 2))
}PRUN-104 Unknown class
Incorrect
monalisa {
priyoKeep u = priyoCreate UnknownClass()
}Correct
monalisa {
lisaaFamily User {}
priyoKeep u = priyoCreate User()
}PRUN-105 Unknown callable
Incorrect
monalisa {
priyoKeep x = 10
x()
}Correct
monalisa {
lisaaTask x() {
priyoTell("ok")
}
x()
}PRUN-106 Property error
Incorrect
monalisa {
priyoKeep x = priyoEmpty
priyoTell(x.name)
}Correct
monalisa {
priyoKeep x = { name: "mona" }
priyoTell(x.name)
}PRUN-107 Argument mismatch
Incorrect
monalisa {
lisaaTask add(a, b) {
priyoGiveBack a + b
}
priyoTell(add(10))
}Correct
monalisa {
lisaaTask add(a, b) {
priyoGiveBack a + b
}
priyoTell(add(10, 5))
}PRUN-108 Invalid input
Incorrect
monalisa {
priyoKeep age = priyoListenNumber("Age: ")
priyoTell(age + 1)
}Correct
monalisa {
priyoKeep age = priyoListenNumber("Age: ")
prakritiIf (age == priyoEmpty) {
priyoTell.Warn("Invalid number")
} prakritiElse {
priyoTell(age + 1)
}
}PRUN-109 Unknown package
Incorrect
monalisa {
lisaaBring maths
}Correct
monalisa {
lisaaBring math
}PRUN-110 Unknown module
Incorrect
monalisa {
lisaaBring "./college.priyoo": college
}Correct
monalisa {
lisaaBring "./college.priyo": college
}Notes:
The diagnostic now includes Import source and a Tried paths list so you can see exactly which files were attempted.
PRUN-111 File not found
Incorrect
monalisa {
lisaaBring files
priyoTell(files.readText("missing.txt"))
}Correct
monalisa {
lisaaBring files
prakritiIf (files.exists("missing.txt")) {
priyoTell(files.readText("missing.txt"))
} prakritiElse {
priyoTell("File not found")
}
}PRUN-112 Task cancelled
Incorrect
monalisa {
prakritiWait lisaaTask worker(token) {
token.throwIfCancelled()
priyoGiveBack "done"
}
priyoKeep group = priyoConcurrency.group("cancel")
priyoKeep token = group.token()
priyoKeep task = group.run(worker, token)
group.cancel("Stopped by user")
priyoTell(prakritiPause task.join())
}Correct
monalisa {
prakritiWait lisaaTask worker(token) {
token.throwIfCancelled()
priyoGiveBack "done"
}
priyoKeep group = priyoConcurrency.group("cancel")
priyoKeep token = group.token()
priyoKeep task = group.run(worker, token)
group.cancel("Stopped by user")
prakritiTry {
priyoTell(prakritiPause task.join())
} prakritiCatch (err) {
priyoTell(err.code)
}
}Engine Error
PENG-001 Internal engine error
This is not a user-code logic mistake. It indicates an internal runtime/compiler/core issue.
Action:
- Save minimal reproducible
.priyocode. - Run with
monalisa -trace <file>. - Report with code, output, and environment details.
Reporting engine failures
For PENG-001, include the error code, source snippet, CLI command, and PriyoScript version in
your report.
Practice Questions
Concept Check
- Which stage does
PSYN-002belong to, and why? 2. What is the difference betweenPRUN-109andPRUN-110? 3. When should you treat an error as engine-level (PENG-001)?
Related Docs
Last updated on