add convenience function for ajax erorr