From e166aef18b2e916e76effdf47ff864f74054dc5e Mon Sep 17 00:00:00 2001 From: Tommi Rantanen Date: Tue, 22 Aug 2023 12:05:22 +0300 Subject: [PATCH] lib: nrf_cloud: Fix error handling for ground fix When cloud side sent an error code, it was converted into -EBADMSG instead of -EFAULT as nrf_cloud_location_process() documentation mentions. Signed-off-by: Tommi Rantanen --- subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c index 28f65d7f4d4..aa41388117e 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c @@ -2930,12 +2930,12 @@ int nrf_cloud_location_response_decode(const char *const buf, /* Check for error code */ ret = get_error_code_value(loc_obj, &result->err); if (ret) { - /* Indicate that an nRF Cloud error code was found */ - ret = -EFAULT; - } else { /* No data or error was found */ LOG_ERR("Expected data not found in location message"); ret = -EBADMSG; + } else { + /* Indicate that an nRF Cloud error code was found */ + ret = -EFAULT; } cleanup: