Skip to content

Handle configuration panics - #11935

Merged
fdncred merged 1 commit into
nushell:mainfrom
ayax79:handle_config_panic
Feb 22, 2024
Merged

fdncred merged 1 commit into
nushell:mainfrom
ayax79:handle_config_panic

Conversation

@ayax79

@ayax79 ayax79 commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

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

fdncred commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

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

ayax79 commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

Yes, I tested with each.

@fdncred

fdncred commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

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 <[email protected]>
@ayax79
ayax79 deleted the handle_config_panic branch August 8, 2024 16:49
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