Break on all exceptions including caught ones
Stop at the line where an error is thrown, even when a try/catch swallows it, using Pause on caught exceptions in Chrome DevTools.
An error is thrown, caught by a try/catch that ignores it, and the page misbehaves with nothing in the console. Pausing on exceptions shows the original throw.
function loadSettings() {
try {
return JSON.parse(localStorage.getItem("settings"));
} catch {
console.log("recovered");
return {};
}
}If the stored value is not valid JSON, the code logs recovered and moves on, so the console shows only that:
recoveredIn the Sources panel, click the Pause on exceptions button, tick Pause on caught exceptions, and reload. DevTools now stops at the JSON.parse line with the SyntaxError available in scope, and the call stack leads back to the caller. Details are in the DevTools pause guide.
The option catches every handled exception in the page, including those thrown by libraries as part of their normal control flow, so it can stop often. Turn it on when needed and off after, or add a condition in the call stack to ignore library files by blackboxing them.
In Node.js DevTools and VS Code, the same option is available under breakpoints as "Caught Exceptions".