nushell/crates/nu-protocol/src/errors
Ian Manske 399a7c8836
Add and use new Signals struct (#13314)
# Description
This PR introduces a new `Signals` struct to replace our adhoc passing
around of `ctrlc: Option<Arc<AtomicBool>>`. Doing so has a few benefits:
- We can better enforce when/where resetting or triggering an interrupt
is allowed.
- Consolidates `nu_utils::ctrl_c::was_pressed` and other ad-hoc
re-implementations into a single place: `Signals::check`.
- This allows us to add other types of signals later if we want. E.g.,
exiting or suspension.
- Similarly, we can more easily change the underlying implementation if
we need to in the future.
- Places that used to have a `ctrlc` of `None` now use
`Signals::empty()`, so we can double check these usages for correctness
in the future.
2024-07-07 22:29:01 +00:00
..
cli_error.rs Refactor the CLI code a bit (#12782) 2024-05-10 07:29:27 +08:00
labeled_error.rs bump rust-toolchain to 1.75.0 (#12258) 2024-03-21 13:23:39 -05:00
mod.rs Better generic errors for plugins (and perhaps scripts) (#12236) 2024-03-21 12:27:21 +01:00
parse_error.rs Restrict strings beginning with quote should also ending with quote (#13131) 2024-06-28 09:47:12 +08:00
parse_warning.rs Deprecate --numbered from for (#13112) 2024-06-10 03:01:22 +00:00
shell_error.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00