Skip to content
← Index | Lesson 4 of 4

@retry and @log

@retry and @log

@retry(n) tries the function up to N times in case of error. @log records input/output automatically.

@log
fn process(data: str) -> str {
    return data |> String.upper()
}

@retry(3)
fn fetch_data() -> str {
    // tries up to 3x in case of failure
    return "data"
}

In this browser lesson, verification confirms the decorator and the output panel shows stdout. The actual @log entries are written to stderr when you run the program with the Zolo CLI.

Goal: Add @log to transform and verify that the program still produces the expected stdout.

lesson-7-4.zolo
Program output

Run the code to see the output

Search Zolo

9 results

enespt-br