skip to content

In Chrome DevTools, what do Pause on uncaught exceptions and Pause on caught exceptions each stop on, and when do you need the second?

level: middleimportance: should knowfreq 42%

answer

  1. two checkboxes in the Breakpoints pane
  2. will any handler catch this throw?
  3. stops at the throw, before unwinding
  4. silent catch means an empty Console
  5. expect noise from library code

basics

~20 s

Pause on uncaught exceptions stops on a throw no handler will catch; Pause on caught exceptions stops on a throw a handler will absorb. You need the second when something swallows an error and the feature fails silently.

solid answer

~50 s

Both are checkboxes in the **Breakpoints** pane of the **Sources** panel, and they work independently. **Pause on uncaught exceptions** stops on a throw that no handler will catch, the kind that usually reaches the **Console** as an error. **Pause on caught exceptions** stops on a throw that a `try/catch` further up will handle. I need that second one when a feature fails silently: a wrapper catches the error, shows nothing and the Console stays clean, so there is nothing to start from. The pause lands on the throwing line before the stack unwinds, so the **Call Stack** and **Scope** panes still show the state that caused it, and the Local scope lists the `Exception` itself. The cost is noise, because libraries can throw and catch as normal control flow, so I tick it just before reproducing and resume through anything unrelated.

go deeper

for a junior

Recall where the two checkboxes live and what each word means: an uncaught throw has no handler, and a caught throw has one. Know that an empty Console does not prove nothing went wrong.

for a middle

Explain that the pause lands at the throw, before unwinding, and why that keeps the failing frames inspectable. Give the swallowed-error case as the reason the caught checkbox exists, and name its cost in noise.

for a senior

Show the working method: arm it late to skip startup noise, read the Exception entry in Local, walk the Call Stack, and swap to a conditional breakpoint once you know the place. Treat a surprising classification as a prediction, not a fact.

for a principal

The decision here is really about code, not the tool. Broad catch blocks that drop errors are what make this checkbox necessary, so the lead's angle is what the team's error handling should report before anyone needs a debugger.

## What an exception pause gives you An **exception pause** stops the debugger at the moment an error is thrown, without you knowing where that will be. That makes it different from a line-of-code breakpoint, which needs you to choose a place first. It also beats reading an error after the fact, because a logged message tells you what went wrong while a pause leaves the whole call stack and every local variable available to inspect. The controls are two checkboxes in the **Breakpoints** pane in the **Sources** panel of Chrome DevTools. **Caught** and **uncaught** describe what happens after the throw. A throw is *caught* if some enclosing `try/catch` will handle it, and *uncaught* if nothing will. In a page's debugging session, the checkboxes are independent, which gives four states: | Pause on uncaught exceptions | Pause on caught exceptions | The debugger pauses on | |---|---|---| | off | off | No exception at all | | on | off | Throws that no handler will catch | | off | on | Throws that a handler will catch | | on | on | Both handled and unhandled throws | When it stops, the banner reads `Paused on exception`, with the error's description beneath it. In the case of a promise, the reason can read as a `promise` rejection instead. ## Why the caught checkbox matters for silent failures An uncaught error announces itself in the **Console**, so you already have a place to start. The hard case is the feature that does nothing and logs nothing, which is what a broad `catch` produces: ```js async function submitOrder(cart) { try { await postOrder(buildPayload(cart)); // buildPayload throws on one malformed item } catch (err) { setBusy(false); // the error is dropped: no message, the button just seems dead } } ``` Nothing here reaches the Console, and **Pause on uncaught exceptions** never fires, because the handler catches the error. **Pause on caught exceptions** stops on the line inside `buildPayload` that throws. You see the malformed item in Scope immediately, without having known that `submitOrder` existed. ## Reading the pause 1. Read the banner for the error's type and message. 2. Open **Local** in the **Scope** pane. DevTools adds an `Exception` entry there holding the thrown value. 3. Read the **Call Stack** pane from the top down. The frames show how execution reached the throw, and they are live, so clicking one switches Scope to its variables. 4. Step once if you want to see who handles it. Execution moves to the `catch` block that will absorb the error. The key property is the timing: the pause happens **at the throw**, before the stack unwinds. By the time the `catch` block runs, the frames between it and the throw are gone, along with their local variables. That is why stopping at the throw reveals more than a breakpoint in the catch block does. ## Keeping the noise down Libraries can use exceptions as ordinary control flow, for example to probe for a browser feature or to parse something optimistically. With the caught checkbox on, each of those stops you. Some ways to manage that: - **Tick it late.** Set a line-of-code breakpoint at the start of the failing action, then tick the checkbox while paused there. Everything thrown during page load has already passed. - **Resume through the irrelevant ones** with `F8`, reading the banner each time. - **Turn it off afterwards.** A forgotten checkbox makes the next debugging session stop in unrelated code. - **Narrow it once you know the place.** A conditional breakpoint on the throwing line is quieter than a global setting. ## Promises and prediction The debugger has to classify a throw at the moment it happens, before any handler has run, so "caught" is a prediction. Inside an `async` function or a promise chain, that prediction depends on what handlers exist at that point. A handler attached later can make a rejection look uncaught even though the program eventually handles it, so treat a surprising classification as a hint rather than a verdict. The difference in how an `Error` object carries its stack is a separate subject, covered with error stacks and causes. ## Mistakes to avoid - Concluding that nothing was thrown because the Console is empty. A swallowing `catch` produces exactly that. - Setting a breakpoint in the `catch` block and expecting the failing frames to still be there. - Leaving the caught checkbox on all the time and learning to ignore its pauses.

  • What do you do when Pause on caught exceptions stops dozens of times in a library?
    Tick it later. Set a line-of-code breakpoint at the start of the failing action, reproduce, and tick **Pause on caught exceptions** while paused there, so everything thrown earlier has already passed. Then resume with `F8`, reading the banner on each stop. Once you know which line matters, replace the checkbox with a conditional breakpoint on that line.
  • Why stop at the throw rather than set a breakpoint in the catch block?
    By the time a `catch` block runs, the stack has unwound: the frames between the handler and the throw are gone, along with their local variables. You can read the error's message there, but not the values that caused it. An exception pause stops before that unwinding, so every frame up to the throw is still live and can be inspected.

  • Pause on uncaught exceptions also stops on errors that a try/catch handles.
  • Pause on caught exceptions stops inside the catch block, after the stack has unwound.
  • If the Console shows no error, no exception was thrown.
  • On a page, the caught checkbox works only while the uncaught checkbox is also ticked.
  • Leaving Pause on caught exceptions on all the time costs nothing while debugging.