LogoXCX 2.2
EcosystemNewsDocumentationGitHub
XCX Logo

XCX 2.2

Statically typed, high-performance scripting language for backend automation.

Resources

  • Documentation
  • Latest News
  • Get Started
  • Install XCX
  • Archive

Ecosystem

  • VS Code Extension
  • PAX Manager
  • Math Library

Connect

  • YouTube
  • TikTok
  • GitHub Issues
  • Email Support

© 2026 XCX Language Team. Wszelkie prawa zastrzeżone.

Privacy PolicyTerms of Use

Documentation

Download Full Docs (.zip)

language

  • Syntax
  • Variables
  • Types
  • Operators
  • Control Flow
  • Functions Fibers
  • Collections
  • Json Http
  • Dates
  • Io Terminal
  • String Methods
  • Errors Halt
  • Library Modules

compiler

  • Architecture
  • Lexer
  • Parser
  • Semantics
  • Vm

pax

  • Pax Manual

Errors Halt

XCX 2.2 Error Handling (Halt)

XCX uses a structured halt system for managing runtime conditions and errors.

Halt Levels

Level Behavior Use Case
halt.alert Prints a message; execution continues. Logging, non-critical warnings
halt.error Prints to stderr; aborts the current frame. Recoverable logic errors
halt.fatal Prints a message; terminates the VM immediately. Critical failure, security breach

Examples

halt.alert >! "Cache missed, fetching from DB...";

if (divisor == 0) then;
    halt.error >! "Division by zero!";
    return 0; --- Execution returns to caller from the recovery point
end;

if (NOT db.is_healthy()) then;
    halt.fatal >! "Database corrupted. Emergency shutdown.";
end;

Semantic and Runtime Panics

Certain invalid operations result in an automatic panic (equivalent to halt.fatal or halt.error depending on context):

  • Division by zero (arithmetic)
  • JSON Parse Failure: Invalid string in json.parse() results in an immediate VM exit.
  • Path Traversal: Using .. in store methods or absolute paths outside the project root triggers halt.fatal.
  • Recursion Depth: Exceeding 800 frames triggers halt.error.