Add error functions to ajax oauth calls