Skip to content
ZOLO / TE233 Type · error

timeout result must be handled as Result

`timeout duration { ... }` returns `Result<Any, TimeoutError>`. The timeout failure is ordinary typed control flow — it is not an untyped record, and it is never silently converted to the successful value.

timeout duration { ... } returns Result<Any, TimeoutError>. The timeout failure is ordinary typed control flow; it is not an untyped record and it is not silently converted to the successful value.

let response: Response = timeout 2s { await client.fetch(request) }
//  ^ error[TE233]: handle the Result before using it as Response

Handle or propagate the result explicitly:

let response = timeout 2s { await client.fetch(request) }?

match timeout 2s { await client.fetch(request) } {
    Result::Ok(response) => render(response),
    Result::Err(error) => show_timeout(error.message),
}

See also TE220 for invalid await operands.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br