add raise method to xhr to catch errors in handlers