codegen: CallError out-param instead of throwing wrappers

Per review, the generated sync wrappers expose the error channel as an
optional trailing parameter — add(a, b, &err) — rather than throwing:
explicit, stateless, works on temporaries, and existing call sites
compile unchanged (they keep default-on-failure, now with a qWarning so
failures are visible in the module log). The dispatch catch-all from the
previous commit stays: it contains author exceptions, it doesn't
introduce any.
This commit is contained in:
Dario Gabriel Lipicar
2026-06-12 09:32:07 -03:00
parent 8adb023863
commit bd24fb61ea
7 changed files with 48 additions and 33 deletions
+3 -4
View File
@@ -612,10 +612,9 @@ static int generateProviderDispatch(const QString& headerPath, const QString& ou
methodsByName[m.name].append(&m);
}
// The dispatch body is wrapped in a catch-all: anything the author's code
// (or a generated typed wrapper — see logos::LogosCallError) lets escape
// becomes an ordinary method failure (invalid QVariant) instead of an
// exception unwinding through Qt event dispatch and killing the module
// The dispatch body is wrapped in a catch-all: any exception the author's
// code lets escape becomes an ordinary method failure (invalid QVariant)
// instead of unwinding through Qt event dispatch and killing the module
// process.
s << "QVariant " << className << "::callMethod(const QString& methodName, const QVariantList& args)\n";
s << "{\n";