diff options
-rw-r--r-- | include/ModemManager-enums.h | 4 | ||||
-rw-r--r-- | src/mm-broadband-modem.c | 4 | ||||
-rw-r--r-- | src/mm-iface-modem.c | 14 |
3 files changed, 15 insertions, 7 deletions
diff --git a/include/ModemManager-enums.h b/include/ModemManager-enums.h index fb3fd3efd..fdb75476a 100644 --- a/include/ModemManager-enums.h +++ b/include/ModemManager-enums.h @@ -146,6 +146,7 @@ typedef enum { /*< underscore_name=mm_modem_state >*/ * @MM_MODEM_STATE_FAILED_REASON_UNKNOWN: Unknown error. * @MM_MODEM_STATE_FAILED_REASON_SIM_MISSING: SIM is required but missing. * @MM_MODEM_STATE_FAILED_REASON_SIM_ERROR: SIM is available, but unusable (e.g. permanently locked). + * @MM_MODEM_STATE_FAILED_REASON_UNKNOWN_CAPABILITIES: Unknown modem capabilities. Since 1.20. * @MM_MODEM_STATE_FAILED_REASON_ESIM_WITHOUT_PROFILES: eSIM is not initialized. Since 1.20. * * Enumeration of possible errors when the modem is in @MM_MODEM_STATE_FAILED. @@ -157,7 +158,8 @@ typedef enum { /*< underscore_name=mm_modem_state_failed_reason >*/ MM_MODEM_STATE_FAILED_REASON_UNKNOWN = 1, MM_MODEM_STATE_FAILED_REASON_SIM_MISSING = 2, MM_MODEM_STATE_FAILED_REASON_SIM_ERROR = 3, - MM_MODEM_STATE_FAILED_REASON_ESIM_WITHOUT_PROFILES = 4, + MM_MODEM_STATE_FAILED_REASON_UNKNOWN_CAPABILITIES = 4, + MM_MODEM_STATE_FAILED_REASON_ESIM_WITHOUT_PROFILES = 5, } MMModemStateFailedReason; /** diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 5c87caf2e..3dde167ed 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -12393,6 +12393,10 @@ iface_modem_initialize_ready (MMBroadbandModem *self, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_SIM_STATE)) failed_reason = MM_MODEM_STATE_FAILED_REASON_ESIM_WITHOUT_PROFILES; + else if (g_error_matches (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED)) + failed_reason = MM_MODEM_STATE_FAILED_REASON_UNKNOWN_CAPABILITIES; g_error_free (error); diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 6b8b12cfb..8ef45927c 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -4833,14 +4833,15 @@ load_current_capabilities_ready (MMIfaceModem *self, { InitializationContext *ctx; MMModemCapability caps; - GError *error = NULL; + g_autoptr(GError) error = NULL; ctx = g_task_get_task_data (task); caps = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_capabilities_finish (self, res, &error); if (error) { - g_propagate_error (&ctx->fatal_error, error); - g_prefix_error (&ctx->fatal_error, "couldn't load current capabilities: "); + ctx->fatal_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Failed to load current capabilities: %s", + error->message); /* Jump to the last step */ ctx->step = INITIALIZATION_STEP_LAST; interface_initialization_step (task); @@ -4904,14 +4905,15 @@ load_supported_capabilities_ready (MMIfaceModem *self, { InitializationContext *ctx; GArray *supported_capabilities; - GError *error = NULL; + g_autoptr(GError) error = NULL; ctx = g_task_get_task_data (task); supported_capabilities = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_capabilities_finish (self, res, &error); if (error) { - g_propagate_error (&ctx->fatal_error, error); - g_prefix_error (&ctx->fatal_error, "couldn't load supported capabilities: "); + ctx->fatal_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Failed to load supported capabilities: %s", + error->message); /* Jump to the last step */ ctx->step = INITIALIZATION_STEP_LAST; interface_initialization_step (task); |