def _handle_http_error(error): u"""Extract the error code and reraise a CCCL Error.""" code = error.response.status_code if code == 404: raise cccl_exc.F5CcclResourceNotFoundError(str(error)) elif code == 409: raise cccl_exc.F5CcclResourceConflictError(str(error)) elif code >= 400 and code < 500: raise cccl_exc.F5CcclResourceRequestError(str(error)) else: raise cccl_exc.F5CcclError(str(error))
def _handle_http_error(self, error): u"""Extract the error code and reraise a CCCL Error.""" code = error.response.status_code LOGGER.error("HTTP error(%d): CCCL resource(%s) /%s/%s.", code, self.classname(), self.partition, self.name) if code == 404: raise cccl_exc.F5CcclResourceNotFoundError(str(error)) elif code == 409: raise cccl_exc.F5CcclResourceConflictError(str(error)) elif code >= 400 and code < 500: raise cccl_exc.F5CcclResourceRequestError(str(error)) else: raise cccl_exc.F5CcclError(str(error))
def f(): raise exceptions.F5CcclResourceConflictError()