Summary
In this chapter, we've learned how to capture different errors that PhantomJS can trigger and how to handle them. It is always a good programming practice to handle all errors in specific events practically, so that we can do more or alert our users more about the problems they might encounter. In the next chapter, we will explore PhantomJS's features to capture and save screenshots of the page we've opened. This feature can be used in a variety of ways and can also be of use in debugging the pages when errors occur by taking a snapshot of that page.