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

Update socket error handler #2092

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Update socket error handler #2092

merged 2 commits into from
Nov 13, 2024

Conversation

ariskataoka
Copy link
Member

@ariskataoka ariskataoka commented Nov 13, 2024

Description

This update should help users to have a smoother experience running WP-CLI commands.

  • Clearer error handling: I've categorized critical errors (like network timeouts or unreachable hosts) to ensure they’re still logged and noticeable, while non-critical errors are managed quietly in the background.
  • Better connection recovery: omitting some messages caused by brief network hiccups is less likely to disrupt command streams.
    These changes should make command execution feel more stable and responsive, even if this is not the ideal solution.

Pull request checklist

New release checklist

Steps to Test

Note: to see the actual result, we need to test a wp cli command that will output a large stream and currently will have the "Connection aborted" message in between the streams.

  1. Check out PR.
  2. Run npm run build
  3. Run node ./dist/bin/vip-wp @[APP_NAME].[ENVIRONMENT] -y -- option list --format=json
  4. Connection aborted shouldn't be experienced.

Examples of output
Before:
Screenshot 2024-11-13 at 1 38 45 pm

After:
Screenshot 2024-11-13 at 1 39 08 pm

Copy link
Contributor

github-actions bot commented Nov 13, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

src/bin/vip-wp.js Fixed Show fixed Hide fixed
@ariskataoka ariskataoka changed the title Replace console.log with debug for socket error Update socket error handler Nov 13, 2024
@ariskataoka ariskataoka marked this pull request as ready for review November 13, 2024 02:06
@ariskataoka ariskataoka requested review from a team and sjinks November 13, 2024 03:28
src/bin/vip-wp.js Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Nov 13, 2024

@ariskataoka ariskataoka merged commit 4020878 into trunk Nov 13, 2024
16 checks passed
@ariskataoka ariskataoka deleted the update/socket-error-message branch November 13, 2024 05:13
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