|
20 | 20 |
|
21 | 21 | #include "src/core/ext/transport/cronet/transport/cronet_status.h"
|
22 | 22 |
|
23 |
| -const char* cronet_net_error_as_string(cronet_net_error_code net_error) { |
24 |
| - switch (net_error) { |
25 |
| - case OK: |
26 |
| - return "OK"; |
27 |
| -#define NET_ERROR(label, value) \ |
28 |
| - case CRONET_NET_ERROR_##label: \ |
29 |
| - return #label; |
30 |
| -#include "third_party/objective_c/Cronet/net_error_list.h" |
31 |
| -#undef NET_ERROR |
| 23 | +const char* cronet_status_as_string(cronet_status_code status) { |
| 24 | + switch (status) { |
| 25 | + case CRONET_STATUS_SUCCESS: |
| 26 | + return "CRONET_STATUS_SUCCESS."; |
| 27 | + case CRONET_STATUS_ILLEGAL_ARGUMENT: |
| 28 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT."; |
| 29 | + case CRONET_STATUS_ILLEGAL_ARGUMENT_STORAGE_PATH_MUST_EXIST: |
| 30 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT_STORAGE_PATH_MUST_EXIST."; |
| 31 | + case CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_PIN: |
| 32 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_PIN."; |
| 33 | + case CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HOSTNAME: |
| 34 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HOSTNAME."; |
| 35 | + case CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_METHOD: |
| 36 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_METHOD."; |
| 37 | + case CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_HEADER: |
| 38 | + return "CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_HEADER."; |
| 39 | + case CRONET_STATUS_ILLEGAL_STATE: |
| 40 | + return "CRONET_STATUS_ILLEGAL_STATE."; |
| 41 | + case CRONET_STATUS_ILLEGAL_STATE_STORAGE_PATH_IN_USE: |
| 42 | + return "CRONET_STATUS_ILLEGAL_STATE_STORAGE_PATH_IN_USE."; |
| 43 | + case CRONET_STATUS_ILLEGAL_STATE_CANNOT_SHUTDOWN_ENGINE_FROM_NETWORK_THREAD: |
| 44 | + return "CRONET_STATUS_ILLEGAL_STATE_CANNOT_SHUTDOWN_ENGINE_FROM_NETWORK_" |
| 45 | + "THREAD."; |
| 46 | + case CRONET_STATUS_ILLEGAL_STATE_ENGINE_ALREADY_STARTED: |
| 47 | + return "CRONET_STATUS_ILLEGAL_STATE_ENGINE_ALREADY_STARTED."; |
| 48 | + case CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_STARTED: |
| 49 | + return "CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_STARTED."; |
| 50 | + case CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_INITIALIZED: |
| 51 | + return "CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_INITIALIZED."; |
| 52 | + case CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_INITIALIZED: |
| 53 | + return "CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_INITIALIZED."; |
| 54 | + case CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_STARTED: |
| 55 | + return "CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_STARTED."; |
| 56 | + case CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_REDIRECT: |
| 57 | + return "CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_REDIRECT."; |
| 58 | + case CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_READ: |
| 59 | + return "CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_READ."; |
| 60 | + case CRONET_STATUS_ILLEGAL_STATE_READ_FAILED: |
| 61 | + return "CRONET_STATUS_ILLEGAL_STATE_READ_FAILED."; |
| 62 | + case CRONET_STATUS_NULL_POINTER: |
| 63 | + return "CRONET_STATUS_NULL_POINTER."; |
| 64 | + case CRONET_STATUS_NULL_POINTER_HOSTNAME: |
| 65 | + return "CRONET_STATUS_NULL_POINTER_HOSTNAME."; |
| 66 | + case CRONET_STATUS_NULL_POINTER_SHA256_PINS: |
| 67 | + return "CRONET_STATUS_NULL_POINTER_SHA256_PINS."; |
| 68 | + case CRONET_STATUS_NULL_POINTER_EXPIRATION_DATE: |
| 69 | + return "CRONET_STATUS_NULL_POINTER_EXPIRATION_DATE."; |
| 70 | + case CRONET_STATUS_NULL_POINTER_ENGINE: |
| 71 | + return "CRONET_STATUS_NULL_POINTER_ENGINE."; |
| 72 | + case CRONET_STATUS_NULL_POINTER_URL: |
| 73 | + return "CRONET_STATUS_NULL_POINTER_URL."; |
| 74 | + case CRONET_STATUS_NULL_POINTER_CALLBACK: |
| 75 | + return "CRONET_STATUS_NULL_POINTER_CALLBACK."; |
| 76 | + case CRONET_STATUS_NULL_POINTER_EXECUTOR: |
| 77 | + return "CRONET_STATUS_NULL_POINTER_EXECUTOR."; |
| 78 | + case CRONET_STATUS_NULL_POINTER_METHOD: |
| 79 | + return "CRONET_STATUS_NULL_POINTER_METHOD."; |
| 80 | + case CRONET_STATUS_NULL_POINTER_HEADER_NAME: |
| 81 | + return "CRONET_STATUS_NULL_POINTER_HEADER_NAME."; |
| 82 | + case CRONET_STATUS_NULL_POINTER_HEADER_VALUE: |
| 83 | + return "CRONET_STATUS_NULL_POINTER_HEADER_VALUE"; |
| 84 | + case CRONET_STATUS_NULL_POINTER_PARAMS: |
| 85 | + return "CRONET_STATUS_NULL_POINTER_PARAMS."; |
| 86 | + case CRONET_STATUS_NULL_POINTER_REQUEST_FINISHED_INFO_LISTENER_EXECUTOR: |
| 87 | + return "CRONET_STATUS_NULL_POINTER_REQUEST_FINISHED_INFO_LISTENER_" |
| 88 | + "EXECUTOR."; |
32 | 89 | }
|
33 | 90 | return "UNAVAILABLE.";
|
34 | 91 | }
|
0 commit comments