fix: enhance error handling for invalid request types in relay handlers

This commit is contained in:
CaIon
2025-08-23 13:34:56 +08:00
parent 060ce89286
commit 13301d8544
8 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ func RerankHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *typ
rerankReq, ok := info.Request.(*dto.RerankRequest)
if !ok {
common.FatalLog(fmt.Sprintf("invalid request type, expected dto.RerankRequest, got %T", info.Request))
return types.NewErrorWithStatusCode(fmt.Errorf("invalid request type, expected dto.RerankRequest, got %T", info.Request), types.ErrorCodeInvalidRequest, http.StatusBadRequest, types.ErrOptionWithSkipRetry())
}
request, err := common.DeepCopy(rerankReq)