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