net: lwm2m: return observe errors immediately

Instead of continuing to do_read_op(), let's handle errors during
observe processing immediately.

Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
Michael Scott 2018-08-27 13:59:18 -07:00 committed by Anas Nashif
commit a166ba77c4

View file

@ -3329,9 +3329,12 @@ static int handle_request(struct coap_packet *request,
accept);
if (r < 0) {
SYS_LOG_ERR("add OBSERVE error: %d", r);
goto error;
}
} else {
SYS_LOG_ERR("OBSERVE request missing token");
r = -EINVAL;
goto error;
}
} else if (observe == 1) {
/* remove observer */