Back to Lingo

Exception

An exception is an error condition that interrupts the normal flow of a program. When something goes wrong—such as invalid input, a missing file, or a failed network request—the system raises an exception to signal the problem. Programmers handle exceptions with try/catch blocks or equivalent mechanisms depending on the language. Exceptions help prevent crashes by allowing code to gracefully recover or produce meaningful error messages.

Why it matters

Well-handled exceptions improve application stability and user experience. Without exception handling, programs would crash frequently or silently fail. Understanding exceptions is crucial for designing robust systems, especially when interacting with external APIs, databases, or file systems.

Examples

Catching a JSON parsing error or handling a timeout when calling a remote endpoint are common examples. Lessons like Error Handling Philosophy provide guidance on designing error systems.

See More

Further Reading

You need to be signed in to leave a comment and join the discussion