Skip to content

Define more errors#367

Open
joy4eg wants to merge 1 commit intocaddyserver:masterfrom
joy4eg:master
Open

Define more errors#367
joy4eg wants to merge 1 commit intocaddyserver:masterfrom
joy4eg:master

Conversation

@joy4eg
Copy link

@joy4eg joy4eg commented Jan 23, 2026

Fixes #365

Copilot AI review requested due to automatic review settings January 23, 2026 13:16
Copy link

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

This PR implements standardized error definitions to allow clients to check for specific error conditions using errors.Is(). It addresses issue #365 by defining two exported error variables (ErrCertNotAvailable and ErrCertTimeout) and updating error returns throughout the handshake code to use these standardized errors.

Changes:

  • Added two exported error variables (ErrCertNotAvailable and ErrCertTimeout) for standardized error checking
  • Updated multiple error return statements to wrap these errors using fmt.Errorf with %w
  • Added test coverage to verify ErrCertNotAvailable can be detected using errors.Is()

Reviewed changes

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

File Description
handshake.go Defines two new error variables and updates 5 error return locations to use them with proper error wrapping
handshake_test.go Adds import for errors package and adds test assertion to verify ErrCertNotAvailable is properly detectable

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

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.

Add more standardized error definitions

1 participant