Error codes

E0334: the error of a T! value is ignored

In a terminal: auk explain E0334 prints this page.

On this page

The call can fail, and its result is thrown away, so its error would vanish silently. Auk requires every error to be handled visibly: pass it up with ?, handle it with else, or discard it explicitly with let _ =.

Wrong#

auk
fn save(): ()! = ()
fn main(): ()! {
  save()
  print("saved")
}

Fixed#

auk
fn save(): ()! = ()
fn main(): ()! {
  save()?
  print("saved")
}

Common causes#

  • Calling fs.write, fs.remove or another fallible function as a statement.
  • Deliberately ignoring an error: write let _ = save() so the choice is visible.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page