Handle allocation errors in UI layer #155
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
UI currently calls arena functions without checking the result. It is reasonable to expect that 1MB of memory is enough for most cases but it would be nice to explicitly log an error and crash. This behavior should also be documented - in Zig arena allocation can return explicit errors, and UI functions don't expose errors which can make the user think it can't fail. API-wise, the UI code is better off without error propagation (except on init), it just needs to fail fast and document that it'll do so.
This came out of #154
See #154 (comment)
I'm not sure it's worth it returning allocation errors and handling them. I think it's better to leave it to the host to do an orderly shutdown. But maybe you had a specific scenario in mind. What would a user actually do with an allocation error in the UI?