Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nushell: throw instead of abort #6870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

JoaquinTrinanes
Copy link
Contributor

Description

This PR prevents lib.hm.nushell.toNushell from unconditionally aborting the evaluation if an error is detected, allowing consumers to tryEval the result and provide a fallback value.

The abort was there originally because it's what the toLua function it's based on does, but I think it makes sense to throw in most cases. I'd even argue this should be a treewide change :)

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or ./format.

  • Code tested through nix-shell --pure tests -A run.all
    or nix build --reference-lock-file flake.lock ./tests#test-all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@Philipp-M @aidalgol

@aidalgol
Copy link
Contributor

Seems reasonable to me. @Philipp-M is the main maintainer of the home-manager Nushell module, so I'll defer to him on this one.

@khaneliman khaneliman merged commit 355a6b9 into nix-community:master May 2, 2025
3 checks passed
@JoaquinTrinanes JoaquinTrinanes deleted the nushell-allow-tryEval branch May 2, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants