Skip to content

Handling errors instead of propagating them up and killing the REPL - #11953

Merged
IanManske merged 7 commits into
nushell:mainfrom
ayax79:handle_repl_loop_err
Feb 24, 2024
Merged

IanManske merged 7 commits into
nushell:mainfrom
ayax79:handle_repl_loop_err

Conversation

@ayax79

@ayax79 ayax79 commented Feb 23, 2024 •

Copy link
Copy Markdown
Contributor

Handle all errors that happen within the REPL loop, display warning or error messages, and return defaults where necessary.

This addresses @IanManske Comment Item 1 in #11860

@IanManske IanManske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ayax79 ! Only one or two notes:

Comment thread crates/nu-cli/src/repl.rs Resolved
Comment thread crates/nu-cli/src/repl.rs Resolved

@IanManske IanManske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just two last things:

Comment thread crates/nu-cli/src/repl.rs Resolved
Comment thread crates/nu-cli/src/repl.rs Resolved
- Handle errors as warning in do_run_cmd. Adde
- Readded missing conditional
@ayax79

ayax79 commented Feb 24, 2024

Copy link
Copy Markdown
Contributor Author

@IanManske I addressed both!

On another note, it looks like the windows runner is failing for an unrelated issue:

---- commands::network::http::get::http_get_expired_cert_override stdout ----
 ---- commands::network::http::get::http_get_expired_cert_override stdout ----
=== stderr
Error: nu::shell::network_failure

  × Network failure
   ╭─[source:1:21]
 1 │ http get --insecure https://expired.badssl.com/
   ·                     ─────────────┬─────────────
   ·                                  ╰── Cannot make request to https://expired.badssl.com/, there was an error establishing a connection.
   ╰────


thread 'commands::network::http::get::http_get_expired_cert_override' panicked at crates\nu-command\tests\commands\network\http\get.rs:256:5:
assertion failed: actual.out.contains(\"<html>\")
   ╰────

@fdncred

fdncred commented Feb 24, 2024

Copy link
Copy Markdown
Contributor

That stupid test needs to be commented out I guess because it fails so often. I restarted the failed ci jobs.

@IanManske IanManske added this to the v0.91.0 milestone Feb 24, 2024
@IanManske IanManske added the deprecated:pr-errors Deprecated: use A:error-handling, A:error-unhelpful, or A:error-silent-fail instead label Feb 24, 2024
@IanManske

Copy link
Copy Markdown
Member

Thanks again @ayax79 !

@IanManske
IanManske merged commit 995989d into nushell:main Feb 24, 2024
kik4444 pushed a commit to kik4444/nushell-fork that referenced this pull request Feb 28, 2024
Handle all errors that happen within the REPL loop, display warning or
error messages, and return defaults where necessary.

This addresses @IanManske [Comment Item
1](nushell#11860 (comment))
in nushell#11860

---------

Co-authored-by: Jack Wright <[email protected]>
IanManske added a commit that referenced this pull request Feb 28, 2024
# Description
Ignores some network tests that sometimes fail in CI. E.g., in
[11953](#11953 (comment))
and
[11654](#11654 (comment)).
@ayax79
ayax79 deleted the handle_repl_loop_err branch April 13, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated:pr-errors Deprecated: use A:error-handling, A:error-unhelpful, or A:error-silent-fail instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants