Handle unsuccessful HTTP requests