Added function to check http status from http errors