MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / raise_feature_unavailable

Function raise_feature_unavailable

src/exceptions.cxx:397–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397PyObject*
398raise_feature_unavailable(const char* message, const char* file, int line)
399{
400 // TODO: is this possible?
401 if (cached_feature_unavailable_exc == nullptr) {
402 // Fallback to ValueError if exception not cached yet
403 PyErr_SetString(PyExc_ValueError, message);
404 return nullptr;
405 }
406
407 PyObject* args = PyTuple_New(0);
408 PyObject* kwargs = PyDict_New();
409 PyDict_SetItemString(kwargs, "message", PyUnicode_FromString(message));
410
411 PyObject* exc_info = build_exc_info_dict(file, line, message);
412 if (exc_info != nullptr) {
413 PyDict_SetItemString(kwargs, "exc_info", exc_info);
414 Py_DECREF(exc_info);
415 }
416
417 PyObject* exc = PyObject_Call(cached_feature_unavailable_exc, args, kwargs);
418 Py_DECREF(args);
419 Py_DECREF(kwargs);
420
421 if (exc != nullptr) {
422 PyErr_SetObject(cached_feature_unavailable_exc, exc);
423 Py_DECREF(exc);
424 }
425
426 return nullptr;
427}
428
429PyObject*
430raise_unsuccessful_operation(const char* message, const char* file, int line)

Callers 1

handle_range_scan_opMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected