catch xhr errors