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