mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Continue and Break on Try/Catch (#7683)
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com> Fixes https://github.com/nushell/nushell/issues/7656
This commit is contained in:
committed by
GitHub
parent
771270d526
commit
9b617de6f0
@ -57,6 +57,13 @@ impl Command for Try {
|
||||
|
||||
match result {
|
||||
Err(error) | Ok(PipelineData::Value(Value::Error { error }, ..)) => {
|
||||
if let nu_protocol::ShellError::Break(_) = error {
|
||||
return Err(error);
|
||||
} else if let nu_protocol::ShellError::Continue(_) = error {
|
||||
return Err(error);
|
||||
} else if let nu_protocol::ShellError::Return(_, _) = error {
|
||||
return Err(error);
|
||||
}
|
||||
if let Some(catch_block) = catch_block {
|
||||
let catch_block = engine_state.get_block(catch_block.block_id);
|
||||
let err_value = Value::Error { error };
|
||||
|
Reference in New Issue
Block a user