mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
The previous implementation of open_file had a lambda that was used to inspect the call of ErrorOr-returning calls. This was a non-standard way of doing this though, as the more usual and clearer way is to have an inner function that returns ErrorOr, then handle any incoming errors on the top level function. This commit adds a try_open_file function, where all the logic occurs, and all the failure-producing steps are simplied TRY'ed. The top level open_file function takes that result and does what the lambda previously did: showing a message box with the actual error.
14 KiB
14 KiB