mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-31 17:51:07 +00:00
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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user