Errors
Arc error code reference for compile-time and runtime errors
Arc errors fall into two categories: compile-time errors (caught before deployment) and runtime errors (occur during execution).
Error code format
Arc error codes follow the pattern:
ARC<category><number>Compile-time errors
The compiler catches these before deployment.
Type system errors (ARC2xxx)
Example: TypeMismatch
// Error: cannot add i32 and f64
x i32 := 42
y f64 := x + 1.0Fix: Use explicit type casting:
x i32 := 42
y f64 := f64(x) + 1.0Function errors (ARC3xxx)
Example: FuncArgCount
func add(x f64, y f64) f64 {
return x + y
}
// Error: expected 2 arguments, got 1
result := add(5.0)Symbol errors (ARC4xxx)
Example: SymbolUndefined
// Error: undefined symbol 'ox_pt_1'
value := ox_pt_1 // channel doesn't exist in clusterExample: SymbolRedefined
x := 42
x := 100 // Error: x already declaredfunc example() {
x := 10
if x > 0 {
x := 20 // Error: conflicts with outer x
}
}Common error messages
Runtime errors
These errors occur during execution and stop the Arc task (but not the Driver).
Arithmetic errors
// Runtime error if b is 0
result := a / bPrevention:
if b != 0 {
result := a / b
}Array/string errors
data := [1.0, 2.0, 3.0]
value := data[5] // Runtime error: index 5 out of boundsPrevention:
if index < len(data) {
value := data[index]
}Error isolation
A runtime error in one Arc task only stops that task. Other tasks and the hardware driver continue running normally. The error status is reported to Console where you can see what went wrong.
Debugging
Check task status
When an Arc automation doesn’t behave as expected:
- Check the task status in Console
- Runtime errors (division by zero, out-of-bounds) stop the task and report the error
- The error message indicates what went wrong
Use LSP diagnostics
The text editor shows compile-time errors inline:
- Red underline: Error (won’t compile)
- Yellow underline: Warning (compiles but suspicious)
- Hover for error message and suggested fix
Write intermediate values
Write intermediate values to channels for debugging:
func debug_controller(value f64) f64 {
error := value - setpoint
// Write to channel for visibility
debug_error = f"Error is: {error}"
return error * gain
}Monitor these channels in Console to trace data flow.