| 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); |
no test coverage detected