Refactor HTTPError