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

Cleaning up branching logic in runSimulator #1352

Merged
merged 5 commits into from
Jan 22, 2024
Merged

Conversation

shonfeder
Copy link
Contributor

Address the cleanups noted in discussion of #1340

Shon Feder added 4 commits January 22, 2024 10:16
Fix the representation of simulation results so that of there are
errors, we return an outcome with an error status and errors, and not
otherwise. Also remove some redundant declarations.
@shonfeder shonfeder requested a review from bugarela January 22, 2024 17:22
const elapsedMs = Date.now() - startMs
const elapsedMs = Date.now() - startMs

switch (result.outcome.status) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now case analysis, so there is one, and only one, branch for each outcome. This also ensures that we'll get static checks to enforce we handle new statuses if they are introduced.

@shonfeder shonfeder self-assigned this Jan 22, 2024
@shonfeder shonfeder added the tech-debt Technical debt label Jan 22, 2024
Copy link
Collaborator

@bugarela bugarela left a comment

Choose a reason for hiding this comment

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

Great improvement!

@shonfeder shonfeder merged commit 5f28689 into main Jan 22, 2024
15 checks passed
@shonfeder shonfeder deleted the sf/refactor-cli-commands branch January 22, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants