// Example 8: Error Handling
// Demonstrates: Try/catch, error messages
// Usage: ruchy examples/cli/08_error_handling.ruchy
fun divide(a, b) {
if b == 0 {
panic("Division by zero!")
}
a / b
}
// Safe division
println(f"10 / 2 = {divide(10, 2)}")
println(f"15 / 3 = {divide(15, 3)}")
// This would panic (uncomment to test):
// println(f"10 / 0 = {divide(10, 0)}")
println("Error handling example completed!")