Catching jsdom errors