-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Recording this as a follow-up item from #12668. Currently, App::run as well as App::run_return will panic if the setup hook provided in Builder::setup fails.
This isn't very clean and we should instead cleanly shut-down the application (where possible). I believe this can be achieved by refactoring the callback passed to the runtime to support returning a value (like ControlFlow or Result). On platforms that support it (everything but iOS I think?), this could abort the event-loop and return a value which in turn would allow Tauri to gracefully return from run and run_return.
As we do this, we may want to consider deprecating App::run altogether and perhaps simply document that on iOS, App::run_return will never return. Maybe we can even express this in the type-signature with a cfg and a never-like type?