Error Handling

Comprehensive guide to Error Handling in Linea

Error Handling

Use explicit checks and clear messages for predictable behavior.

Input Validation

var batch_size @ int = 0

if batch_size <= 0 {
    display "batch_size must be positive"
} else {
    display "starting training"
}

Filesystem Operation Checks

import system

if system::exists("config.json") {
    display "config found"
} else {
    display "config missing"
}