Docs menu

E132: recover is being used in a way that can't work

What compiler error E132 means, and how to fix it.

recover handles a call that can fail. It has two rules, and Turf found one broken.

It needs something that can fail. Only a call whose declared return type starts with ! – fn read(): !string – can be followed by recover. An ordinary call has nothing to recover from:

Example
fn f(): int { return 1; }mut v: int = f() recover produce 0;       // f() can't fail

Drop the recover, or make the function fallible if it really can fail: fn f(): !int.

A recover run { ... } block has to leave. When it doesn’t produce a value, the expression it is attached to has no value to become, so every path through the block must end in return:

Example
mut text: string = read("a.txt") recover run {    io::printline("couldn't read it");};                                         // falls out the bottom: no valuemut text: string = read("a.txt") recover run {    io::printline("couldn't read it");    return 1;};

Or supply the value directly: recover produce "".

Run turf --explain E132 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.