Skip to content

Move job errors into ShellError::Job variant - #15820

Merged
sholderbach merged 8 commits into
nushell:mainfrom
cptpiepmatz:refactor/job-error
May 26, 2025
Merged

sholderbach merged 8 commits into
nushell:mainfrom
cptpiepmatz:refactor/job-error

Conversation

@cptpiepmatz

Copy link
Copy Markdown
Member

Description

In my endeavor to make the ShellError less crowded I moved the job related errors into ShellError::Job with a JobError enum. Mostly I just moved the codes, errors and labels over to the new enum.

User-Facing Changes

Tests + Formatting

  • 🟢 toolkit fmt
  • 🟢 toolkit clippy
  • 🟢 toolkit test
  • 🟢 toolkit test stdlib

After Submitting

@sholderbach sholderbach 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.

Love it!

Comment on lines +40 to +42
impl<M> Id<M, usize> {
pub const ZERO: Self = Self::new(0);
}

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.

Is this associated constant used anywhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I used it here:

In this case is zero a special id, I am not entirely sure if that is the case for other ids too but I thought this emphasizes the special-ness

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.

Makes sense

@sholderbach
sholderbach merged commit 9a968c4 into nushell:main May 26, 2025
@github-actions github-actions Bot added this to the v0.105.0 milestone May 26, 2025
@cptpiepmatz
cptpiepmatz deleted the refactor/job-error branch May 26, 2025 18:04
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.

2 participants