Skip to content

Conversation

@molon
Copy link
Contributor

@molon molon commented Sep 2, 2025

No description provided.

Copy link
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

This PR adds Connect mux functionality with VProto error handling and improves error handling hooks throughout the codebase. The changes introduce a new Connect multiplexer that can handle both VProto and Connect error formats while standardizing error message formatting.

  • Adds new Connect mux implementation with VProto error handling support
  • Improves error handling hooks and simplifies error writer configuration
  • Standardizes error message capitalization and removes unused imports

Reviewed Changes

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

Show a summary per file
File Description
connectx/mux.go New Connect multiplexer with VProto error handling and gRPC protocol rejection
statusx/vproto.go Updates VProto error handling to support Connect errors and simplifies configuration
statusx/http.go Improves HTTP error writer with better hook handling and error message formatting
normalize/grpc.go Replaces statusx with standard errors package and updates error messages
gormx/database.go Removes inject tag from tracing configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cursor[bot]

This comment was marked as outdated.

// Why not use statusx.TranslateError? Just to avoid affecting the original prottp releated logic.
err, _ := TranslateStatusErrorOnly(ctx, input.Conf.I18N, input.Err)
written := WriteConnectErrorOnly(errWriter, input.W, input.R, err)
return &HTTPWriteErrorOutput{Written: written}, nil
Copy link

Choose a reason for hiding this comment

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

Bug: Middleware Chain Breakage and Unnecessary Allocations

The VProtoHTTPWriteErrorHook now directly writes a Connect error when EnsureConnectError(ctx) is true, bypassing the next handler and breaking the middleware chain. Additionally, connect.NewErrorWriter() is instantiated for each error, leading to unnecessary allocations and potential performance impact.

Fix in Cursor Fix in Web

@molon molon merged commit 40135ad into master Sep 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants