mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
At present, the GUI client uses a monolithic `Error` enum that represents all kinds of errors. Some of them are unused (see #7956). Others are only used during startup, like the `deep_link` and `WebViewNotInstalled` variants. This makes it difficult to write correct error handling code. In addition to remove certain variants in #7965, this PR refactors the `run::gui` function to not depend on this `Error` at all. Instead, we use `anyhow::Result` and probe for particular errors that we want to special-case. This is a bit less type-safe because there is no source code-level connection between the source site that emits an error and the error handling code. In the worst case, any regression here is "just" a slight degradation in UX: We will show a generic error dialog instead of a tailored message. This risk is deemed acceptable in exchange for an easier to understand control flow.