Skip to content

More type-safe getErrorCode#8695

Merged
alexr00 merged 1 commit intomainfrom
alexr00/holy-cardinal
Apr 23, 2026
Merged

More type-safe getErrorCode#8695
alexr00 merged 1 commit intomainfrom
alexr00/holy-cardinal

Conversation

@alexr00
Copy link
Copy Markdown
Member

@alexr00 alexr00 commented Apr 23, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 23, 2026 09:48
@alexr00 alexr00 enabled auto-merge (squash) April 23, 2026 09:48
@alexr00 alexr00 self-assigned this Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves type-safety in githubRepository.ts by tightening getErrorCode’s input type and adding guarded property access, reducing reliance on any when extracting error codes for logging/telemetry.

Changes:

  • Introduces a local isObject type guard for safe property probing on unknown.
  • Updates getErrorCode signature from any to unknown and rewrites extraction logic with explicit runtime checks.
  • Preserves existing behavior for known error shapes (status, networkError.statusCode, GraphQL extensions code, code, name).
Show a summary per file
File Description
src/github/githubRepository.ts Makes getErrorCode more type-safe by using unknown + runtime narrowing for error-code extraction.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@alexr00 alexr00 merged commit 69af9f2 into main Apr 23, 2026
10 checks passed
@alexr00 alexr00 deleted the alexr00/holy-cardinal branch April 23, 2026 14:29
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.

3 participants