liveBook · Manning

Error value

An error value is a value that represents a failure condition and can be returned or otherwise handled as data.

How 2 Manning books explain it

Go in Action, Second Edition

An error value is a Go value of the error type that reports whether an operation encountered a problem.

How it is used
Uses error values to make failures visible in function results and handle them close to the operation.
How deep it goes
Explains return conventions, nil checks, the error interface, and handling choices; defers detailed wrapping and panic recovery.
Examples
Illustrates errors with os.ReadFile, a key/value store interface, and logging followed by os.Exit.
What you can do after
Apply error checks to function calls and choose whether to return, log, retry, or explicitly ignore a failure.

Read how Go in Action, Second Edition explains error value →

Systems Programming with Zig

An error value is a value representing a failure condition that a Zig operation or function can return.

How it is used
Signals operation or function failure and makes handling part of valid code.
How deep it goes
Defines failure values and requires handling or explicit discard, while describing compiler checks over declared error sets.
What you can do after
Apply explicit error handling by handling or deliberately discarding errors and return values.

Read how Systems Programming with Zig explains error value →

Also covered in

Related concepts

Questions about error value

What is error value?

An error value is a value that represents a failure condition and can be returned or otherwise handled as data.

Which Manning books explain error value?

Go in Action, Second Edition and Systems Programming with Zig.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.