Quick answer: An error is any problem or incorrect condition; an exception is a specific mechanism programming languages use to signal and handle errors at runtime. An unhandled exception often becomes a crash.

'Error' and 'exception' get used interchangeably, but they're different concepts: one is a general problem, the other a specific language mechanism. Understanding the distinction helps you reason about crashes and error handling. Here's the difference.

What an Error Is

An error is broadly any incorrect or problematic condition, something went wrong. It's a general term: a file that won't load, invalid input, a network failure, a logic mistake are all errors. 'Error' describes the problem itself, at a conceptual level, regardless of how the code handles it.

Errors range from recoverable (retry the network request) to fatal (corrupt state). The term doesn't specify a mechanism, just that something is wrong. Bugnet captures errors and crashes from your game with context, so you can see what's going wrong regardless of how it's technically represented.

What an Exception Is

An exception is a specific runtime mechanism many programming languages provide to signal and handle errors. When code hits a problem, it 'throws' an exception, which propagates up until something 'catches' and handles it. Exceptions are the structured way code reacts to errors, a language feature, not the problem itself.

An exception is how an error is signaled and handled in code. If an exception is caught and handled, the program recovers; if it's unhandled, it typically crashes the program. Bugnet captures unhandled exceptions as crashes, with the stack trace showing where the exception was thrown.

How They Relate

The relationship: an exception is a mechanism for dealing with errors at runtime. An error is the underlying problem; an exception is often how the code represents and propagates that problem. Crucially, an unhandled exception usually becomes a crash, which is why exceptions matter for stability.

Bugnet captures crashes and the exceptions behind them with stack traces, so you can see which unhandled exceptions are crashing your game. So treat 'error' as the general concept of something being wrong, and 'exception' as the specific runtime mechanism, with unhandled exceptions being a common path to crashes.

An error is any problem; an exception is a runtime mechanism for signaling and handling errors. An error is the problem, an exception is how code handles it, and an unhandled exception often becomes a crash.