Added error handlers to phantom and phantom.page