forked from espressif/esp-idf
when items are not sent, complete or returned, make the function return an error instead of checking the state in an assert.
when items are not sent, complete or returned, make the function return an error instead of checking the state in an assert.