-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors: Don't unwrap in server::os_input_output
#1895
Merged
har7an
merged 16 commits into
zellij-org:main
from
har7an:errors/dont-unwrap-in-server-os-input-output
Nov 2, 2022
Merged
errors: Don't unwrap in server::os_input_output
#1895
har7an
merged 16 commits into
zellij-org:main
from
har7an:errors/dont-unwrap-in-server-os-input-output
Nov 2, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to use `anyhow::Result` instead. This mostly makes the need of custom `SpawnTerminalError` obsolete (tbd in subsequent commits) and unifies error handling across the application.
to replace any previously defined, isolated custom error types throughout the application. Currently implements all error variants found in `SpawnTerminalError`. In the long term, this will allow zellij to fall back to a single error type for all application-specific errors, instead of having different error types per module.
with updated `Result`-types.
with updated `Result`-types.
with updated `Result`-types.
rather than a `&'static str`, which isn't compatible with `anyhow::Context`.
which is returned due to the changed return types in `ServerOsApi`.
originating in the change to the `ServerOsApi` trait definition.
originating in the change to the `ServerOsApi` trait definition.
originating in the change to the `ServerOsApi` trait definition.
originating in the change to the `ServerOsApi` trait definition.
originating in the change to the `ServerOsApi` trait definition. The functions here don't return a `Result` yet, this is better left to a follow-up PR.
and make use of the new `ZellijError` instead. Make use of `anyhow`s downcast capabilities to restore the underlying original errors where necessary, as was done previously. This gives us the flexibility to attach context information to all errors while still allowing us to handle specific errors in greater detail.
har7an
force-pushed
the
errors/dont-unwrap-in-server-os-input-output
branch
from
November 2, 2022 04:41
fa613bf
to
147a706
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rewrites the
os_input_output
module to handle/propagate errors withanyhow::Error
instead of unwrapping on allResult
types. Also unifies all error types regarding this module to byanyhow::Error
.As part of this PR the previously existing
SpawnTerminalError
is entirely removed and replaced with a newZellijError
. Better documentation on that will follow in a subsequent PR.