Revert PRs for 0.99.1 patch (#14119)

# Description

Temporarily reverts PRs merged after the 0.99.1 bump.
This commit is contained in:
Ian Manske
2024-10-17 19:51:14 -07:00
committed by GitHub
parent e735bd475f
commit 28b6db115a
33 changed files with 287 additions and 782 deletions

View File

@ -220,17 +220,8 @@ fn eval_ir_block_impl<D: DebugContext>(
}
Err(err) => {
if let Some(error_handler) = ctx.stack.error_handlers.pop(ctx.error_handler_base) {
let fancy_errors = match ctx.engine_state.get_config().error_style {
nu_protocol::ErrorStyle::Fancy => true,
nu_protocol::ErrorStyle::Plain => false,
};
// If an error handler is set, branch there
prepare_error_handler(
ctx,
error_handler,
Some(err.into_spanned(*span)),
fancy_errors,
);
prepare_error_handler(ctx, error_handler, Some(err.into_spanned(*span)));
pc = error_handler.handler_index;
} else {
// If not, exit the block with the error
@ -255,7 +246,6 @@ fn prepare_error_handler(
ctx: &mut EvalContext<'_>,
error_handler: ErrorHandler,
error: Option<Spanned<ShellError>>,
fancy_errors: bool,
) {
if let Some(reg_id) = error_handler.error_register {
if let Some(error) = error {
@ -264,10 +254,7 @@ fn prepare_error_handler(
// Create the error value and put it in the register
ctx.put_reg(
reg_id,
error
.item
.into_value(error.span, fancy_errors)
.into_pipeline_data(),
error.item.into_value(error.span).into_pipeline_data(),
);
} else {
// Set the register to empty