MCPcopy Create free account
hub / github.com/apache/arrow / ToCError

Method ToCError

cpp/src/arrow/c/bridge.cc:2179–2195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2177
2178 private:
2179 int ToCError(const Status& status) {
2180 if (ARROW_PREDICT_TRUE(status.ok())) {
2181 private_data()->last_error_.clear();
2182 return 0;
2183 }
2184 private_data()->last_error_ = status.ToString();
2185 switch (status.code()) {
2186 case StatusCode::IOError:
2187 return EIO;
2188 case StatusCode::NotImplemented:
2189 return ENOSYS;
2190 case StatusCode::OutOfMemory:
2191 return ENOMEM;
2192 default:
2193 return EINVAL; // Fallback for Invalid, TypeError, etc.
2194 }
2195 }
2196
2197 PrivateData* private_data() {
2198 return reinterpret_cast<PrivateData*>(stream_->private_data);

Callers 2

StaticGetSchemaMethod · 0.95
StaticGetNextMethod · 0.95

Calls 4

okMethod · 0.45
clearMethod · 0.45
ToStringMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected