Failure
A failure is an event or condition in which an operation, component, or system does not achieve an expected result or perform its intended function.
Go in Practice, Second Edition
An error is a condition indicating that an operation failed or produced a result outside expected behavior while the program may still be able to continue.
- How it is used
- Handles unsuccessful operations through explicit return values so callers can respond or pass failures upward.
- How deep it goes
- Works through return conventions, nil checks, custom error types, panic boundaries, recovery, and HTTP responses.
- Examples
- Uses string concatenation, parser locations, division by zero, and HTTP error responses to show different failure paths.
- What you can do after
- Build it from scratch: return and check Go errors, add structured details when useful, and distinguish recoverable failures from panics.
The Art of Code
Failure is a program outcome in which an operation cannot complete its intended contract or produces an unsuccessful result.
- How it is used
- Frames failure as an explicit outcome to design alongside success, including partial results and recovery.
- How deep it goes
- Classifies failures and gives practical handling guidance, from boundary validation and exception translation to logging and investigation.
- Examples
- Illustrates failures with an expired discount code, unavailable service, invalid input, and infrastructure problems.
- What you can do after
- Apply failure-handling strategies by category, protect boundaries, preserve diagnostic causes, and investigate reproducible problems.
Learn Go with Pocket-Sized Projects
An error as a value is an explicit value representing an operation failure that code returns and handles directly.
- How it is used
- Uses returned error values to make unsuccessful operation paths explicit and give callers handling decisions.
- How deep it goes
- Explains custom sentinel errors, wrapping, type inspection, and failure-path tests through implementations.
- Examples
- Uses a word-corpus reader, decimal parser, timed HTTP client, and JSON error response.
- What you can do after
- Apply error handling in Go using errors.Is and errors.As to recognize and inspect failures.
Read how Learn Go with Pocket-Sized Projects explains failure →
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
Error is the discrepancy between a model's actual output and the expected output for an input.
- How it is used
- Uses output error to guide backpropagation and adjust neural-network weights.
- How deep it goes
- Explains error propagation, deltas, and weight updates, but stops short of deriving formulas with calculus.
- Examples
- Uses output-neuron deltas, hidden-layer deltas, and layer-wide weight updates as worked visual examples.
- What you can do after
- Apply it via backpropagation to distribute output errors and update network weights.
Data Pipelines with Apache Airflow, Second Edition
An error is a failure condition or abnormal event reported during system operation.
- How it is used
- Identifies unsuccessful Airflow tasks and system errors so operators can locate, recover from, and monitor pipeline problems.
- How deep it goes
- Walks through failure states, log inspection, retries, and targeted reruns; gives monitoring examples without specifying alert thresholds.
- Examples
- Uses a failed image download, its ConnectionError stack trace, and Airflow graph and grid views.
- What you can do after
- Diagnose/debug with it by finding a failed task, reading its logs, fixing the cause, and clearing affected tasks for rerun.
Read how Data Pipelines with Apache Airflow, Second Edition explains failure →
Modern C, Third Edition
An error condition is a detected circumstance indicating that an operation cannot proceed normally or has not produced a valid result.
- How it is used
- Guides C programs in preventing invalid operations, checking results, preserving error state, and performing graceful cleanup.
- How deep it goes
- Develops precondition checks, return-value conventions, errno preservation, cleanup paths, and limits of recovery; defers detailed signal and threading treatment.
- Examples
- Uses puts with EOF, perror and exit, plus fprintnumbers with invalid arguments, overflow, allocation failure, errno restoration, and output errors.
- What you can do after
- Diagnose and handle C failures by checking documented results, inspecting errno, selecting recovery paths, and centralizing cleanup.
Distributed Machine Learning Patterns
An event in which a component, operation, or workflow step does not complete as intended.
- How it is used
- Handles machine-learning workflow failures to preserve useful work and reduce negative effects on users.
- How deep it goes
- Distinguishes temporary from permanent failures and gives diagnostic recovery steps, but does not specify an implementation framework.
- Examples
- Uses lost database connectivity, preempted workers, memory exhaustion, missing in-memory data, and competing model-training branches.
- What you can do after
- Diagnose/debug with runtime metadata, classify failure causes, and choose between retrying a step or restarting dependencies.
Read how Distributed Machine Learning Patterns explains failure →
100 Go Mistakes and How to Avoid Them
An error value is a value representing an error condition that can be compared, returned, or propagated by a Go program.
- How it is used
- Represents failure conditions as returned values that callers handle, compare, log, wrap, or propagate.
- How deep it goes
- Explains ordinary returns, sentinel values, error types, wrapping, comparison, and deferred cleanup, but not package internals.
- Examples
- Uses sql.ErrNoRows, io.EOF, database row cleanup, and deferred Close errors to expose comparison and handling choices.
- What you can do after
- Diagnose error-handling mistakes and choose whether to compare, wrap, log, return, propagate, or explicitly ignore failures.
Read how 100 Go Mistakes and How to Avoid Them explains failure →
Go in Action, Second Edition
An error is a value or condition indicating that an operation failed or cannot produce its intended result.
- How it is used
- Uses failures to make resilient Go programs handle unexpected conditions through explicit return values and control flow.
- How deep it goes
- Explains error values, interfaces, propagation, wrapping, custom types, inspection, logging, and panic boundaries.
- Examples
- Demonstrates ignored errors, key/value lookups, bulk retrieval, missing-key aggregation, logging, and wrapped unexpected failures.
- What you can do after
- Diagnose/debug with it by checking, logging, propagating, wrapping, and type-inspecting failures in Go code.
The Design of Web APIs, Second Edition
An error is a condition indicating that processing cannot proceed normally or that an intended result was not produced.
- How it is used
- Identifies missing API capabilities by examining what prevents users from completing use-case steps.
- How deep it goes
- Traces step failures through causes and remedies, then classifies action outputs; defers detailed error-response design.
- Examples
- Uses empty carts, unavailable products, missing product details, and searches with no matching products.
- What you can do after
- Practice/perform failure analysis to find missing steps and classify operation outputs independently of consumer context.
Read how The Design of Web APIs, Second Edition explains failure →
Functional Design and Architecture: Examples in Haskell
An error is a condition in software or its environment indicating that a computation or requested operation cannot produce the intended result.
- How it is used
- Frames failure handling as an engineering concern involving errors, exceptions, dependency boundaries, and architectural error domains.
- How deep it goes
- Distinguishes errors from exceptions and prescribes domain separation with boundary conversion, without specifying one universally preferred implementation.
- Examples
- Uses Haskell’s exception mechanisms, Rust’s lack of exceptions, native errors, and architectural error-domain boundaries as concrete illustrations.
- What you can do after
- Evaluate/understand whether a failure is an error or exception and place its representation and handling at an appropriate domain boundary.
Read how Functional Design and Architecture: Examples in Haskell explains failure →
The Art of AI Product Development
An AI mistake is an incorrect, misleading, unsupported, or otherwise undesirable output or behavior produced by an AI system.
- How it is used
- Uses failure classification and transparent communication to manage AI products and build stakeholder trust.
- How deep it goes
- Defines four failure types and gives forecasting examples, but stops short of technical diagnosis or model-level remediation.
- Examples
- Uses inventory forecasts, flash sales, post-holiday demand, uncertain forecasts, and regional growth to illustrate mistakes.
- What you can do after
- Diagnose with failure categories, review forecasts manually, supply contextual inputs, and intervene when outputs are uncertain.
Read how The Art of AI Product Development explains failure →
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
An error is an abnormal condition or event that causes software to produce incorrect behavior or prevents it from completing an operation.
- How it is used
- Uses failure handling to protect users and business operations when microservices encounter expected or unexpected errors.
- How deep it goes
- Defines failure sources and outlines retry, notification, abort-and-restart, and resume strategies without detailing every implementation path.
- Examples
- Uses runtime exceptions, faulty sensor or human input, RabbitMQ failure, Azure Storage failure, and uncaught-exception handlers.
- What you can do after
- Diagnose/debug with logs and choose recovery actions for anticipated and unexpected microservice failures.
Also covered in
- Lead Developer Career Guide
- Math and Architectures of Deep Learning
- Build and Orchestrator in Go (From Scratch)
- Interview Speak
- Modern C
- Think Like a CTO
- The Joy of JavaScript
- Akka in Action, Second Edition
- Deep Learning with R, Third Edition
- Refactoring to Rust
- Build Financial Software with Generative AI (From Scratch)
- React Hooks in Action: With Suspense and Concurrent Mode
What to know first
- exceptionAn exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
- GoGo is a statically typed, compiled, general-purpose programming language with garbage collection and built-in support for concurrency.
- contractA contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
- distributed systemA distributed system is a computing system whose components run across multiple networked processes or machines and coordinate through communication.
Related concepts
- exceptioncontrasts with · An exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
- paniccontrasts with · A panic is a runtime failure state or mechanism that interrupts ordinary execution when a failure or violated assumption prevents safe continuation, potentially triggering recovery, stack unwinding, or termination.
- 500 Internal Server Erroraddressed by · 500 Internal Server Error is an HTTP status code indicating that the server encountered an unexpected condition that prevented it from fulfilling a request.
- context Err methodproduced by · Context.Err is a Go method that returns the error explaining a context’s cancellation or deadline expiration, or nil while the context remains active.
- error typeimplemented by · An error type is a data type whose values represent failure conditions and may carry information used to identify, report, or handle them.
Questions about failure
What is failure?
A failure is an event or condition in which an operation, component, or system does not achieve an expected result or perform its intended function.
Which Manning books explain failure?
Go in Practice, Second Edition, The Art of Code, Learn Go with Pocket-Sized Projects, Classic Computer Science Problems in Swift: Essential techniques for practicing programmers, Data Pipelines with Apache Airflow, Second Edition, Modern C, Third Edition, Distributed Machine Learning Patterns, 100 Go Mistakes and How to Avoid Them and 5 more.
What should I know before learning failure?
Manning books that teach failure usually introduce exception, Go, contract and distributed system first.
What is the difference between failure and exception?
A failure is an event or condition in which an operation, component, or system does not achieve an expected result or perform its intended function. An exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
What is failure also called?
Failure is also called error or fail.
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.












