Skip to content

Command err handling - #480

Merged
maaslalani merged 4 commits into
charmbracelet:mainfrom
mastercactapus:command-err-handling
May 31, 2024
Merged

maaslalani merged 4 commits into
charmbracelet:mainfrom
mastercactapus:command-err-handling

Conversation

@mastercactapus

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@mastercactapus

Copy link
Copy Markdown
Contributor Author

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

@maaslalani
maaslalani merged commit 5a207ef into charmbracelet:main May 31, 2024
@maaslalani

Copy link
Copy Markdown
Contributor

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.

2 participants

⌂ 换网址