In this case, curl will subscribe to foo/, i.e. there will be no error message, but it will obviously receive fewer messages than expected if you intended to subscribe to the whole subtree.
Thus, could you also add a warning for this case with reasonable effort? At least in verbose mode to help with debugging if you think it's too much otherwise? ... or could/should there rather be a generic warning for all protocols maybe, in case there is a fragment part and it's being dropped?