| 83 | } |
| 84 | |
| 85 | arrow::StatusCode |
| 86 | garrow_error_to_status_code(GError *error, arrow::StatusCode default_code) |
| 87 | { |
| 88 | if (error->domain != GARROW_ERROR) { |
| 89 | return default_code; |
| 90 | } |
| 91 | |
| 92 | switch (error->code) { |
| 93 | case GARROW_ERROR_OUT_OF_MEMORY: |
| 94 | return arrow::StatusCode::OutOfMemory; |
| 95 | case GARROW_ERROR_KEY: |
| 96 | return arrow::StatusCode::KeyError; |
| 97 | case GARROW_ERROR_TYPE: |
| 98 | return arrow::StatusCode::TypeError; |
| 99 | case GARROW_ERROR_INVALID: |
| 100 | return arrow::StatusCode::Invalid; |
| 101 | case GARROW_ERROR_IO: |
| 102 | return arrow::StatusCode::IOError; |
| 103 | case GARROW_ERROR_CAPACITY: |
| 104 | return arrow::StatusCode::CapacityError; |
| 105 | case GARROW_ERROR_INDEX: |
| 106 | return arrow::StatusCode::IndexError; |
| 107 | case GARROW_ERROR_UNKNOWN: |
| 108 | return arrow::StatusCode::UnknownError; |
| 109 | case GARROW_ERROR_NOT_IMPLEMENTED: |
| 110 | return arrow::StatusCode::NotImplemented; |
| 111 | case GARROW_ERROR_SERIALIZATION: |
| 112 | return arrow::StatusCode::SerializationError; |
| 113 | case GARROW_ERROR_CODE_GENERATION: |
| 114 | return arrow::StatusCode::CodeGenError; |
| 115 | case GARROW_ERROR_EXPRESSION_VALIDATION: |
| 116 | return arrow::StatusCode::ExpressionValidationError; |
| 117 | case GARROW_ERROR_EXECUTION: |
| 118 | return arrow::StatusCode::ExecutionError; |
| 119 | case GARROW_ERROR_ALREADY_EXISTS: |
| 120 | return arrow::StatusCode::AlreadyExists; |
| 121 | default: |
| 122 | return default_code; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | arrow::Status |
| 127 | garrow_error_to_status(GError *error, arrow::StatusCode default_code, const char *context) |
no outgoing calls
no test coverage detected