MCPcopy Create free account
hub / github.com/alibaba/zvec / throw_if_error

Function throw_if_error

src/binding/python/model/python_collection.cc:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace zvec {
20
21inline void throw_if_error(const Status &status) {
22 switch (status.code()) {
23 case StatusCode::OK:
24 return;
25 case StatusCode::NOT_FOUND:
26 throw py::key_error(status.message());
27 case StatusCode::INVALID_ARGUMENT:
28 throw py::value_error(status.message());
29 case StatusCode::INTERNAL_ERROR:
30 case StatusCode::ALREADY_EXISTS:
31 case StatusCode::NOT_SUPPORTED:
32 case StatusCode::PERMISSION_DENIED:
33 case StatusCode::FAILED_PRECONDITION:
34 case StatusCode::UNKNOWN:
35 default:
36 throw std::runtime_error(status.message());
37 }
38}
39
40
41template <typename T>

Callers 3

unwrap_expectedFunction · 0.85
bind_ddl_methodsMethod · 0.85
bind_dml_methodsMethod · 0.85

Calls 1

codeMethod · 0.80

Tested by

no test coverage detected