diff options
author | har7an <99636919+har7an@users.noreply.github.com> | 2022-10-23 13:14:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-23 13:14:24 +0000 |
commit | 75801bdb0e559c73d3f5ea99f1ce1429a425cd1b (patch) | |
tree | abcc1aa1f941f038ef8d328d6ffa79abfc2ff1a9 /zellij-server/src/ui | |
parent | 788bcd6151431222325800e0a46c58384fe0bd22 (diff) |
plugins: Improve error handling on plugin version mismatch (#1838)
* server/tab: Don't panic in `Pane::render`
and do not crash the application on failure to receive a render update
from plugins any longer. Instead, will print a simple string with a hint
to check the application logs, where a more thorough error indication
can be found.
* utils/errors: re-export `anyhow::Error`
to create ad-hoc errors with custom error types, without having to wrap
them into a `context()` before to turn the into anyhow errors.
* plugins: Check plugin version on startup
and terminate execution with a descriptive error message in case the
plugin version is incompatible with the version of zellij being run.
* server/wasm_vm: Add plugin path in version error
so the user knows which plugin to look at in case they're using custom
plugins.
* server/wasm_vm: Check plugin version for equality
Previously we would accept cases where the plugin version was newer than
the zellij version, which doesn't make a lot of sense.
* server/wasm_vm: Prettier error handling
in call to `wasmer::Function::call` in case a plugin version mismatch
can occur.
* tile: Install custom panic handler
that will print the panic message to a plugins stdout and then call a
panic handler on the host that turns it into a real application-level
panic.
* tile: Catch errors in event deserialization
and turn them into proper panics. These errors are symptomatic of an
uncaught plugin version mismatch, for example when developing from main
and compiling zellij/the plugins from source. Normal users should never
get to see this error.
* utils/errors: Improve output in `to_stdout`
for anyhow errors. The default anyhow error formatting of `{:?}` is
already very good, and we just made it worse by trying to invent our own
formatting.
* tile: Reword plugin mismatch error message
* zellij: Apply rustfmt
* changelog: Add PR #1838
Improve error handling on plugin version mismatch.
* server/wasm_vm: Rephrase error in passive voice
Diffstat (limited to 'zellij-server/src/ui')
-rw-r--r-- | zellij-server/src/ui/pane_contents_and_ui.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zellij-server/src/ui/pane_contents_and_ui.rs b/zellij-server/src/ui/pane_contents_and_ui.rs index 779a69094..4db9feb4b 100644 --- a/zellij-server/src/ui/pane_contents_and_ui.rs +++ b/zellij-server/src/ui/pane_contents_and_ui.rs @@ -45,7 +45,8 @@ impl<'a> PaneContentsAndUi<'a> { &mut self, clients: impl Iterator<Item = ClientId>, ) { - if let Some((character_chunks, raw_vte_output, sixel_image_chunks)) = self.pane.render(None) + if let Some((character_chunks, raw_vte_output, sixel_image_chunks)) = + self.pane.render(None).unwrap() { let clients: Vec<ClientId> = clients.collect(); self.output.add_character_chunks_to_multiple_clients( @@ -73,7 +74,7 @@ impl<'a> PaneContentsAndUi<'a> { } pub fn render_pane_contents_for_client(&mut self, client_id: ClientId) { if let Some((character_chunks, raw_vte_output, sixel_image_chunks)) = - self.pane.render(Some(client_id)) + self.pane.render(Some(client_id)).unwrap() { self.output .add_character_chunks_to_client(client_id, character_chunks, self.z_index); |