Skip to content

Validate error standardization fix for unsupported model handling#8

Closed
Copilot wants to merge 1 commit into
refactoring/basic-structurefrom
copilot/sub-pr-6-again
Closed

Validate error standardization fix for unsupported model handling#8
Copilot wants to merge 1 commit into
refactoring/basic-structurefrom
copilot/sub-pr-6-again

Conversation

Copilot AI commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

Validates that commit b8dd547 correctly replaced inline error response construction with standardized GatewayError handling for unsupported model requests.

Changes Verified

  • Error handling consistency: Unsupported model errors now use handleError(c, core.NewInvalidRequestError(...)) instead of manually constructing JSON responses
  • API contract preserved: Response format and status codes remain identical (400 with invalid_request_error type)
  • Test coverage: All existing tests pass, including TestChatCompletionUnsupportedModel

Before/After

// Before (cb82c33)
if !h.provider.Supports(req.Model) {
    return c.JSON(http.StatusBadRequest, map[string]interface{}{
        "error": map[string]interface{}{
            "type":    "invalid_request_error",
            "message": "unsupported model: " + req.Model,
        },
    })
}

// After (b8dd547)
if !h.provider.Supports(req.Model) {
    return handleError(c, core.NewInvalidRequestError("unsupported model: "+req.Model, nil))
}

Both paths produce identical responses but the latter ensures consistency with the centralized error handling system.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Address feedback on error standardization and refactoring Validate error standardization fix for unsupported model handling Dec 7, 2025
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