liveBook · Manning

Error code

An error code is a symbolic or numeric value that identifies or classifies an error or failure condition.

How 3 Manning books explain it

Functional Programming in Scala, Second Edition

An error code is a returned value that indicates an exceptional or failed condition instead of transferring control by throwing an exception.

How it is used
Contrasts returned failure indicators with exceptions while motivating typed, composable error handling.
How deep it goes
Explains propagation risks, call-site boilerplate, polymorphic limitations, and typed alternatives without implementing the generic type.
Examples
Uses C-style return codes, failing functions, and the empty-sequence mean problem to contrast failure-handling policies.
What you can do after
Evaluate error-code designs against silent propagation, boilerplate, polymorphism, and caller-policy costs.

Read how Functional Programming in Scala, Second Edition explains error code →

Systems Programming with Zig

An error code is a value returned or stored to indicate that an operation failed and often identify the failure kind.

How it is used
Reports failure kinds across a C-facing interface and makes failures easier to investigate than a null result.
How deep it goes
Works through integer-backed codes, Zig error translation, and out parameters, then contrasts GLFW error queries and callbacks.
Examples
Uses recipe creation, checked Fibonacci input, and GLFW initialization to demonstrate different error-reporting paths.
What you can do after
Apply error-code translation in Zig when exposing operations to C callers, and inspect GLFW failures by query or callback.

Read how Systems Programming with Zig explains error code →

100 C++ Mistakes and How to Avoid Them

An error return code is a value returned by a function to indicate that an operation encountered an error condition.

How it is used
Distinguishes error-return signaling from exceptions when discussing how functions and constructors handle failure.
How deep it goes
Defines sentinel values, value selection and caller checks, then contrasts exceptions; does not provide an error-code implementation.
Examples
Contrasts return codes with a constructor that rejects a negative age by throwing an exception.
What you can do after
Evaluate whether sentinel choices and caller checks make an error-return scheme ambiguous.

Read how 100 C++ Mistakes and How to Avoid Them explains error code →

Also covered in

What to know first

Related concepts

Questions about error code

What is error code?

An error code is a symbolic or numeric value that identifies or classifies an error or failure condition.

Which Manning books explain error code?

Functional Programming in Scala, Second Edition, Systems Programming with Zig and 100 C++ Mistakes and How to Avoid Them.

What should I know before learning error code?

Manning books that teach error code usually introduce C++, atomic type, exception and integer first.

What is the difference between error code and optional pointer?

An error code is a symbolic or numeric value that identifies or classifies an error or failure condition. An optional pointer is a pointer value type that can represent either a valid address or no address.

What is error code a kind of?

Error code is a kind of sentinel value. A sentinel value is a distinguished value that signals a special condition or control state rather than representing ordinary data.

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.