Skip to content

Adding exported functions for few of the windows errors. - #26

Merged
Prince Pereira (princepereira) merged 3 commits into
mainfrom
ppereira-error-validation
Mar 13, 2026
Merged

Adding exported functions for few of the windows errors.#26
Prince Pereira (princepereira) merged 3 commits into
mainfrom
ppereira-error-validation

Conversation

@princepereira

Copy link
Copy Markdown
Collaborator

Added exported functions to validate few of the windows errors.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands hcn’s Windows error-classification helpers by adding additional exported predicates for common HCN HRESULTs and introduces a unit test to validate these predicates (including behavior through fmt.Errorf("%w", ...) wrapping).

Changes:

  • Add new ErrorCode constants for additional HCN error codes (network/endpoint/port not found, invalid IP).
  • Add new exported Is* helper functions that classify HcnError instances by those codes.
  • Add a Windows-only unit test covering the helper predicates (including wrapped errors).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

FileDescription
hcn/hcnerrors.goAdds new HCN error-code constants and new exported Is* helper predicates.
hcn/hcnerrors_unit_test.goAdds Windows-only unit tests for the new (and existing) error-classification helpers, including wrapped-error cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadhcn/hcnerrors.go Outdated
Comment threadhcn/hcnerrors.go Outdated
Comment threadhcn/hcnerrors_unit_test.go
Comment threadhcn/hcnerrors_unit_test.go Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadhcn/hcnerrors.go
Comment threadhcn/hcnnetwork_test.go
Comment threadhcn/hcnerrors_test.go
Comment threadhcn/hcnerrors_unit_test.go

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadhcn/hcnnetwork_test.go Outdated
Comment threadhcn/hcnnetwork_test.go
Comment threadhcn/hcnerrors_test.go Outdated
@princepereira

Copy link
Copy Markdown
CollaboratorAuthor

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadhcn/hcnloadbalancer_test.go

CopilotAI commented Mar 13, 2026

Copy link
Copy Markdown

Prince Pereira (@princepereira) I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you.

@princepereiraPrince Pereira (princepereira) changed the title Added some exported functions for few of the windows errors.Adding exported functions for few of the windows errors.Mar 13, 2026
@princepereira
Prince Pereira (princepereira)force-pushed the ppereira-error-validation branch 3 times, most recently from c87230d to 4a3ae11CompareMarch 13, 2026 05:40
@princepereira
Prince Pereira (princepereira)force-pushed the ppereira-error-validation branch 10 times, most recently from 89cd4d9 to d5983c1CompareMarch 13, 2026 07:21
@princepereira
Prince Pereira (princepereira) merged commit e115dd1 into mainMar 13, 2026
3 checks passed
Sign up for freeto 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.

5 participants

@princepereira@mdebjit@daschott