andlabs / andlabs/libui

error handling / signalling

Offen
#420 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
10.9k
Forks
612
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

generally error handling seems to be a big todo in libui. Basically there is hardly any... lots of libui's functions have no way of indicating to the caller that something went wrong, let alone what went wrong.

My current concern is this: in lua, signalling an error involved setjmp/longjmp. When building the bindings for the table library, I found that there may be cases when the functions that make up the tablemodelhandler may need to signal an error to the main application. However, this involves jumping over stack frames that may belong to libui, or worse, the underlying system ui code (for the record, the same thing may occur with other callback functions).

I don't really know how to solve this, but I think it would be helpful if I could signal an error from the callback functions to the maib library that may then somehow be retrieved by the embedding application (or language binding, or whatever).

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.