mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #104] How do we handle .NET exceptions? #60
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauldotknopf on GitHub (Feb 6, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/104
This issue serves as a discussion point for handling .NET exceptions in QML.
@pauldotknopf commented on GitHub (Feb 6, 2019):
I'd like to see .NET exceptions raised in QML like regular JS exceptions.
Starting in Qt 5.12, there is a
QJSEngine->throwErrormethod (see here) for raising JS exceptions from c++. This would allow something like this.@pauldotknopf commented on GitHub (Feb 6, 2019):
In order to propogate errors up through all levels, all callbacks/delegates need to return a new
inttype.If we ever invoke a native method from .NET that returns this exception code, we need to check for any pending errors.
Since .NET exceptions can't be marshalled, we must store them in some ambient location. This is the perfect use-case for
QThreadStorage(see here).