Skip to content
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

Handle configuration panics #11935

Merged
merged 1 commit into from Feb 22, 2024
Merged

Conversation

ayax79
Copy link
Contributor

@ayax79 ayax79 commented Feb 22, 2024

Use the default configuration on panic.

Adding a line that panics to any configuration:

# Nushell Config File
#
# version = "0.86.0"
"2031-13-31" | into datetime

An error message will be displayed and the shell will continue:
Screenshot 2024-02-22 at 10 14 25

@fdncred
Copy link
Collaborator

fdncred commented Feb 22, 2024

We have 4 config files. I'm wondering if this works on all of them.

  1. env.nu
  2. config.nu
  3. login.nu
  4. plugins.nu

If I'm reading the changes correctly, I think the answer is yes, it works for a panic in any of those files. Am I reading it right?

@ayax79
Copy link
Contributor Author

ayax79 commented Feb 22, 2024

Yes, I tested with each.

@fdncred fdncred merged commit 99ba365 into nushell:main Feb 22, 2024
19 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Feb 22, 2024

Thanks!

@hustcer hustcer added this to the v0.91.0 milestone Feb 23, 2024
kik4444 pushed a commit to kik4444/nushell-fork that referenced this pull request Feb 28, 2024
Use the default configuration on panic.

Adding a line that panics to any configuration:
```nushell
# Nushell Config File
#
# version = "0.86.0"
"2031-13-31" | into datetime
```

An error message will be displayed and the shell will continue:
<img width="1016" alt="Screenshot 2024-02-22 at 10 14 25"
src="https://github.com/nushell/nushell/assets/56345/8ccff001-300a-4caf-b131-bf7b114a06e3">

Co-authored-by: Jack Wright <jack.wright@disqo.com>
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.

None yet

3 participants