Skip to content

Add timeout and LSP sentinel errors for lint error classification#418

Merged
robinaugh merged 1 commit intomainfrom
jason/lint-sentinel-errors
Mar 11, 2026
Merged

Add timeout and LSP sentinel errors for lint error classification#418
robinaugh merged 1 commit intomainfrom
jason/lint-sentinel-errors

Conversation

@robinaugh
Copy link
Contributor

@robinaugh robinaugh commented Mar 11, 2026

I saw an unhandled error from rwx lint get reported in our telemetry, but we're missing any actionable information. The error cases that can happen when linting that are most important to have visibility into are exceeding the 30-second timeout and any issues with the language server, so this PR categorizes those better.

Other error cases that can occur when linting are up to the user to resolve (i.e. no rwx directory, etc) and don't need to be granularly reported to us for now.

Summary

  • Adds ErrTimeout and ErrLSP sentinel errors so that lint errors are no longer all classified as "unknown" in telemetry
  • Wraps LSP protocol errors (initialize, didOpen, diagnostic, code action) with ErrLSP at both the jsonrpc and check layers
  • Wraps context deadline exceeded errors with ErrTimeout in the jsonrpc request path
  • Adds timeout and lsp_error cases to classifyError in the CLI entry point

Test plan

  • Updated TestJSONRPC_RequestTimeout to assert ErrTimeout sentinel
  • Added TestJSONRPC_RequestLSPError to assert ErrLSP sentinel on LSP error responses
  • All existing tests pass

Lint errors were all classified as "unknown" in telemetry because none
of the errors from the lint path wrapped a recognized sentinel. This
adds ErrTimeout and ErrLSP sentinels so that timeouts and LSP protocol
failures are properly categorized.
@robinaugh robinaugh self-assigned this Mar 11, 2026
@robinaugh robinaugh marked this pull request as ready for review March 11, 2026 19:16
@robinaugh robinaugh merged commit e1504a4 into main Mar 11, 2026
1 check passed
@robinaugh robinaugh deleted the jason/lint-sentinel-errors branch March 11, 2026 21:22
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