| 44 | } |
| 45 | |
| 46 | GArrowError |
| 47 | garrow_error_from_status(const arrow::Status &status) |
| 48 | { |
| 49 | switch (status.code()) { |
| 50 | case arrow::StatusCode::OK: |
| 51 | return GARROW_ERROR_UNKNOWN; |
| 52 | case arrow::StatusCode::OutOfMemory: |
| 53 | return GARROW_ERROR_OUT_OF_MEMORY; |
| 54 | case arrow::StatusCode::KeyError: |
| 55 | return GARROW_ERROR_KEY; |
| 56 | case arrow::StatusCode::TypeError: |
| 57 | return GARROW_ERROR_TYPE; |
| 58 | case arrow::StatusCode::Invalid: |
| 59 | return GARROW_ERROR_INVALID; |
| 60 | case arrow::StatusCode::IOError: |
| 61 | return GARROW_ERROR_IO; |
| 62 | case arrow::StatusCode::CapacityError: |
| 63 | return GARROW_ERROR_CAPACITY; |
| 64 | case arrow::StatusCode::IndexError: |
| 65 | return GARROW_ERROR_INDEX; |
| 66 | case arrow::StatusCode::UnknownError: |
| 67 | return GARROW_ERROR_UNKNOWN; |
| 68 | case arrow::StatusCode::NotImplemented: |
| 69 | return GARROW_ERROR_NOT_IMPLEMENTED; |
| 70 | case arrow::StatusCode::SerializationError: |
| 71 | return GARROW_ERROR_SERIALIZATION; |
| 72 | case arrow::StatusCode::CodeGenError: |
| 73 | return GARROW_ERROR_CODE_GENERATION; |
| 74 | case arrow::StatusCode::ExpressionValidationError: |
| 75 | return GARROW_ERROR_EXPRESSION_VALIDATION; |
| 76 | case arrow::StatusCode::ExecutionError: |
| 77 | return GARROW_ERROR_EXECUTION; |
| 78 | case arrow::StatusCode::AlreadyExists: |
| 79 | return GARROW_ERROR_ALREADY_EXISTS; |
| 80 | default: |
| 81 | return GARROW_ERROR_UNKNOWN; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | arrow::StatusCode |
| 86 | garrow_error_to_status_code(GError *error, arrow::StatusCode default_code) |