fix: enhance error handling for invalid request types in relay handlers
This commit is contained in:
1 parent
060ce89286
commit
13301d8544
8 files changed
+9
-9
No files matched your search
@@ -20,7 +20,7 @@ func EmbeddingHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *
|
||||
|
||||
embeddingReq, ok := info.Request.(*dto.EmbeddingRequest)
|
||||
if !ok {
|
||||
common.FatalLog(fmt.Sprintf("invalid request type, expected *dto.EmbeddingRequest, got %T", info.Request))
|
||||
return types.NewErrorWithStatusCode(fmt.Errorf("invalid request type, expected *dto.EmbeddingRequest, got %T", info.Request), types.ErrorCodeInvalidRequest, http.StatusBadRequest, types.ErrOptionWithSkipRetry())
|
||||
}
|
||||
|
||||
request, err := common.DeepCopy(embeddingReq)
|
||||
|
||||
Reference in new issue
Block a user