fetching error message from http errors