nushell/crates/nu-command/src/debug
Darren Schroeder 11375c19d2
better error handling for view source (#14624)
# Description

There is an opportunity to give a bogus block id to view source. This
makes it more resilient and not panic when an invalid block id is passed
in.


![image](https://github.com/user-attachments/assets/67ebbffc-be57-4ce3-8700-90f1ed080f9b)


# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the
tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-12-18 16:19:49 -06:00
..
ast.rs add new --flatten parameter to the ast command (#14400) 2024-11-20 11:39:15 -06:00
debug_.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
explain.rs Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
info.rs Start to Add WASM Support Again (#14418) 2024-11-30 07:57:11 -06:00
inspect_table.rs fix inspect and explore panics on empty records (#13893) 2024-09-25 07:48:16 -05:00
inspect.rs Start to Add WASM Support Again (#14418) 2024-11-30 07:57:11 -06:00
metadata_access.rs add metadata access command (#13785) 2024-09-11 12:44:06 -05:00
metadata_set.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
metadata.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
mod.rs add view blocks command (#14610) 2024-12-18 06:41:50 -06:00
profile.rs Remove the NU_DISABLE_IR option (#14293) 2024-11-15 12:09:25 +08:00
timeit.rs Make timeit take only closures as an argument (#14483) 2024-12-10 23:08:53 +08:00
view_blocks.rs add view blocks command (#14610) 2024-12-18 06:41:50 -06:00
view_files.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
view_ir.rs Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
view_source.rs better error handling for view source (#14624) 2024-12-18 16:19:49 -06:00
view_span.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
view.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00