zellij/zellij-utils/src
har7an 99e2bef8c6
Feature: Better error handling/reporting (#1670)
* utils: re-export "anyhow" unconditionally

even for wasm targets.

* utils/errors: Share wasm-compatible code

and move everything that can't run in wasm into a separate submodule.

* utils: Share "errors" module unconditionally

The module is now structured such that all code incompatible with wasm
targets lives in its own submodule that isn't included when compiling
for wasm targets.

* utils/errors: Add "Help wanted" doc section

that informs the reader about the endeavour to improve error handling
throughout the zellij code base.

* plugins: Handle errors returned by `zellij_tile`

now that the panic calls have been removed.

* utils/errors: Extend `anyhow::Result` with traits

that allow for easy/concise logging of `anyhow::Result` types and
panicking the application when they are fatal or non-fatal.

* utils/errors: Fix doctest

* utils/errors: Add prelude

that applications can import to conveniently access the error handling
functionality part of the module. Re-exports some parts and macros from
anyhow and the `LoggableError` and `FatalError` traits.

* server/screen: Adopt error handling

and make all fallible functions from the public API return a `Result`.
Append error contexts in all functions that can come across error types
to allow tracing where an error originates and what lead there.

* server/lib: Catch errors from `screen`

and make them `fatal`. This will log the errors first, before unwrapping
on the error type and panicking the application.

* server/unit/screen: Fix unit tests

and unwrap on the `Result` types introduced from the new error handling.

* utils/errors: Track error source

in calls to `fatal`, so we keep track of the location where the panic
really originates. Otherwise, any call to `fatal` will show the code in
`errors` as source, which of course isn't true.
Also change the error formatting and do not call `to_log` for fatal
errors anymore, because the panic is already logged and contains much
more information.

* utils/errors: Update `FatalError` docs

* plugins: Undo accidental modifications

* utils/errors: Improve module docs

explain some error handling facilities and the motivation behind using
them.

* server/screen: Remove `Result` from Infallible

functions that are part of the public API.
2022-09-09 13:21:03 +00:00
..
input fix(terminal): SGR/UTF8 mouse reporting in terminal panes (#1664) 2022-08-17 09:28:51 +02:00
channels.rs refactors for #525 (#534) 2021-05-27 16:28:28 +02:00
cli.rs feat: support themes directory (#1577) 2022-07-24 21:30:58 +09:00
consts.rs fix(status-bar): reflect actual current keybindings (#1242) 2022-07-27 16:48:35 +02:00
data.rs fix(status-bar): reflect actual current keybindings (#1242) 2022-07-27 16:48:35 +02:00
envs.rs feat(terminal): sixel support (#1557) 2022-07-08 17:19:42 +02:00
errors.rs Feature: Better error handling/reporting (#1670) 2022-09-09 13:21:03 +00:00
ipc.rs fix(router): gracefully handle client crashes (#1710) 2022-09-02 15:30:43 +02:00
lib.rs Feature: Better error handling/reporting (#1670) 2022-09-09 13:21:03 +00:00
logging.rs fix: various typos (#1553) 2022-07-02 19:54:50 +02:00
pane_size.rs feat(signals): support XTWINOPS 14 and 16 (and query the terminal for them on startup and SIGWINCH) (#1316) 2022-04-12 18:07:32 +02:00
position.rs fix(terminal): SGR/UTF8 mouse reporting in terminal panes (#1664) 2022-08-17 09:28:51 +02:00
setup.rs fix: theme not loading without config (#1631) 2022-08-02 23:15:33 +09:00
shared.rs fix(status-bar): reflect actual current keybindings (#1242) 2022-07-27 16:48:35 +02:00