From 648e6d49afd8a1b6322c8472be64438ba17e5824 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 25 Sep 2026 15:44:09 -0700 Subject: [PATCH] quest(cpp): C++ errors carry their message Co-Authored-By: Claude Opus 5.5 --- quest/m1/cpp/README.md | 1 + quest/m1/cpp/error-message.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 quest/m1/cpp/error-message.md diff --git a/quest/m1/cpp/README.md b/quest/m1/cpp/README.md index cdb8b38282..4e945df607 100644 --- a/quest/m1/cpp/README.md +++ b/quest/m1/cpp/README.md @@ -51,6 +51,7 @@ reads the same release manifest so a release bumps both. ## Quests - [Package](/quest/m1/cpp/package.md) - the `cpp/moq` wrapper, CMake package, release tarball, interop client, and docs +- [Error messages](/quest/m1/cpp/error-message.md) - a C++ `moq::Error` prints the same message Rust gives - [OBS migration](/quest/m1/cpp/obs.md) - the OBS plugin moves from libmoq handles and trampolines to the generated C++ ## Related diff --git a/quest/m1/cpp/error-message.md b/quest/m1/cpp/error-message.md new file mode 100644 index 0000000000..07e11f95be --- /dev/null +++ b/quest/m1/cpp/error-message.md @@ -0,0 +1,21 @@ +# [XS] C++ errors carry their message + +## Goal + +A `moq::Error` from the C++ package prints the same message Rust's `Display` +gives, so callers and the interop client log a reason rather than a variant +name. + +## Plan + +- The generator emits no `Display` for errors. Prefer exposing the message + through moq-ffi once (e.g. a method on the error the generator already + binds) over hand-written per-variant strings in the wrapper. +- Use it in the interop client and the doc samples. + +Public API: additive on the C++ package, and on moq-ffi if a method is added. +Wire: none. + +## Related + +- [#4187](https://github.com/moq-dev/moq/pull/4187) - the package that found it