Error Handling

Manage anticipated deviations with robust error handling constructs.

Attempt & Recover

KEIKAKU Protocol
1attempt:
2 # Risky operation
3 result := divide(10, 0)
4 declare(result)
5recover error:
6 declare("Something unexpected:", error)

Disrupt Generators

Throw exceptions into active generators for cleaner resource management.

KEIKAKU Protocol
1sequence worker():
2 cycle while true:
3 attempt:
4 yield "working"
5 recover err:
6 yield "Recover: " + text(err)
7
8gen := worker()
9proceed(gen)
10
11# Inject error
12disrupt(gen, "Timeout Exception")

Anomaly Blocks

Mark code sections that deviate from standard logic.

KEIKAKU Protocol
1anomaly:
2 # Unsafe experimental code
3 api_call_without_validation()