replyErr method
Sends an error reply to this query with a string value.
Error replies carry a payload + optional encoding ONLY. There is no
key expression and (by design) no attachment: zenoh-c's
z_query_reply_err_options_t exposes only an encoding field. Use this to
signal that the query could not be served successfully.
Throws StateError if the query has been disposed. Throws ZenohException if the reply fails.
Implementation
void replyErr(String value, {Encoding? encoding}) {
// ALLOCATE-LAST: replyErrBytes' only pre-move guard is the disposed-query
// check, so running it here keeps that throw ahead of the ZBytes this
// method builds and nothing else owns.
_ensureNotDisposed();
final zbytes = ZBytes.fromString(value);
replyErrBytes(zbytes, encoding: encoding);
}