Uncaught exception
An uncaught exception is an error thrown while a program runs that no surrounding code catches, so it propagates to the top of the call stack and the runtime deals with it instead. In a browser it stops the code that was running at that moment, logs the error and its stack trace to the console, and leaves the page in whatever state it had reached.
The longer version
Code throws an exception when it hits a condition it cannot continue from: a property read on an undefined value, a function called on the wrong type, a JSON parse on a body that was HTML. The throw unwinds the stack looking for a try block that catches it. When none exists, the runtime's default handler runs. In a browser that handler abandons the rest of that task, fires the window's error event, which is what error-monitoring scripts listen to, and writes the error to the console with the file, line and stack unless a listener on that event suppressed it. Later events still get their handlers, which is why a page can keep half-working after one.
A caught exception is the same error intercepted by a try and catch block that decides what happens next, whether that is a retry, a fallback or a friendly message. The uncaught kind is the one the developer did not anticipate. The nearest relative is the unhandled promise rejection, which is the asynchronous equivalent: a rejection nobody attached a handler to. Browsers report the two through different events and the stack trace on a rejection is often less useful, which matters when reading a console.
Uncaught exceptions produce the classic silent failure. A click handler throws on its second line, the rest of the handler never runs, and the user sees a button that does nothing. Nothing is wrong on the server. The exception is in the console with a line number, but only in that user's browser, until a reload clears it. A second failure mode is the swallowing catch, where code catches everything and logs nothing, so the exception is neither uncaught nor visible and the bug is harder to find than if it had been left alone.
Common questions
What happens when an exception is not caught?
The error propagates up the call stack until the runtime's default handler takes it. In a browser, the code running at that moment stops there, the error and its stack trace are logged to the console, and the page stays in whatever state it had reached. Other event handlers on the page continue to work, so the failure is often partial.
Is catching every exception better than leaving it uncaught?
A catch block that catches everything and logs nothing makes a failure harder to find than an uncaught exception, because the console shows no entry and the window's error event never fires, so monitoring sees nothing either. Catch where the code can do something useful with the failure, such as a retry or a message the user can act on, and let the rest propagate to the console where a tester can read it.
Is an uncaught exception always a bug?
An uncaught exception is always something the code did not plan for, which is a defect in error handling even when the underlying cause is external, such as an API returning an unexpected shape. Whether it matters to users depends on what it interrupted, so the report should say what the user was doing when it fired.
How do you find the cause of an uncaught exception?
Read the console entry from the top: the message says what went wrong, the file and line say where it was thrown, and the stack trace lists the calls that led there. The first frame inside the application's own code, rather than a library, is where to start. Minified code needs source maps loaded for the line numbers to mean anything.
Can uncaught exceptions be caught globally?
A global handler on the window's error event receives every uncaught exception with its message, source and stack, which is how error-monitoring scripts collect them. The handler is for logging and reporting only: the code that was interrupted is not resumed, and a handler that hides the error from the console makes the bug harder to see rather than fixed.
Bug reports that arrive ready to triage.
Collect replay, console, network and browser context with the Free plan.