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

Function throw_if_error

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

Source from the content-addressed store, hash-verified

47} // namespace
48
49inline void throw_if_error(const Status &status) {
50 switch (status.code()) {
51 case StatusCode::OK:
52 return;
53 case StatusCode::NOT_FOUND:
54 throw py::key_error(status.message());
55 case StatusCode::INVALID_ARGUMENT:
56 throw py::value_error(status.message());
57 case StatusCode::INTERNAL_ERROR:
58 case StatusCode::ALREADY_EXISTS:
59 case StatusCode::NOT_SUPPORTED:
60 case StatusCode::PERMISSION_DENIED:
61 case StatusCode::FAILED_PRECONDITION:
62 case StatusCode::UNKNOWN:
63 default:
64 throw std::runtime_error(status.message());
65 }
66}
67
68
69template <typename T>

Callers 3

unwrap_expectedFunction · 0.85
bind_ddl_methodsMethod · 0.85
bind_dml_methodsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected