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

Command err handling #480

Merged
merged 4 commits into from
May 31, 2024

Conversation

mastercactapus
Copy link
Contributor

Updates command functions to return errors when unable to continue.

  • Many silently ignored errors are now reported
  • Fixed a race condition where some early SET commands would fail to access term if it hadn't started yet.

Dependency of #257 to address the concern of stopping/bubbling up if an error occurs without resorting to panic #257 (comment)

- Modified function signatures to return errors
- Added error checks after command executions
- Added specific error messages for different failures
- Updated the handling of parser errors for source tape parsing
- Altered evaluator to incorporate the revised error handling
- Moved the logic for waiting until the "window.term" variable is accessible from VHS setup to evaluation phase
- This ensures the proper timing and handling of errors related to the 'term' variable access (some SET commands access term)
@maaslalani
Copy link
Member

This is fantastic @mastercactapus, thank you for this awesome work!

@mastercactapus
Copy link
Contributor Author

@maaslalani pushed a fix for the lint issue that came up

@maaslalani maaslalani merged commit 5a207ef into charmbracelet:main May 31, 2024
8 checks passed
@maaslalani
Copy link
Member

Tested this out and it worked great. This is a great improvement to VHS, thank you so much!

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

2 participants