Chapter 4. Capturing Errors
Sometimes, we will encounter unexpected problems that generate errors triggered by PhantomJS scripts or from the page itself. There are several ways to handle errors and exceptions in our script; we can use callbacks that are readily available in PhantomJS or through JavaScript exception handling. More often, we combine both to have a much better way of capturing errors.