Skip to content

Commit

Permalink
lib: nrf_cloud: Fix error handling for ground fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
trantanen authored and nordicjm committed Sep 8, 2023
1 parent ecbd150 commit e166aef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e166aef

Please sign in to comment.