<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_error_response(self, exc):
 """ Generate HttpResponse based on the HttpStatusCodeError. """

        if exc.has_code(codes.UNAUTHORIZED):
            return self._get_auth_challenge(exc)
        else:
            if exc.has_code(codes.INTERNAL_SERVER_ERROR):
                logging.getLogger('devil').error('devil caught http error: ' + str(exc), exc_info=True)
            else:
                logging.getLogger('devil').error('devil caught http error: ' + str(exc))
            content = exc.content or ''
            return HttpResponse(content=content, status=exc.get_code_num())