«   Previous tip Next tip   »

Chrome DevTools: Automatically pause on any JavaScript exception

Last updated: 26th July 2020
Automatically pause on any JavaScript exception

Introduction

In DevTools, you can automatically pause on any JavaScript exception (especially useful for uncaught exceptions). Just enable 'Pause on exceptions' within the Sources Panel. Optionally, you can also pause on caught exceptions.

This means the debugger will pause before that red message appears in the Console and you get a chance to inspect what may have gone wrong.

How to use this feature

  1. In the Sources Panel, click the Pause on exceptions button
  2. Cause an exception to occur

And that's it! The debugger will pause allowing you to inspect the current state of JavaScript execution and find out what went wront.

Extra

While your debugger is paused, there's a little trick to getting the entire stack trace into your clipboard - which can be helpful for further debugging, or even pasting it into a bug report.

«   Previous tip Next tip   »

Sign up to receive a developer tip, in the form of a gif, in your inbox each week