sensor: shell: Show the error code when reading fails

The error code may give a clue as to what is wrong. Add it to the error
message.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-05-15 16:21:19 -06:00 committed by Anas Nashif
commit 9b8c04401d

View file

@ -129,7 +129,7 @@ static int cmd_get_sensor(const struct shell *shell, size_t argc, char *argv[])
err = sensor_sample_fetch(dev);
if (err < 0) {
shell_error(shell, "Failed to read sensor");
shell_error(shell, "Failed to read sensor: %d", err);
}
if (argc == 2) {