diff --git a/internal/controller/copilot/code_completions.go b/internal/controller/copilot/code_completions.go index e1a6740..30b669f 100644 --- a/internal/controller/copilot/code_completions.go +++ b/internal/controller/copilot/code_completions.go @@ -18,9 +18,9 @@ import ( "time" ) -// abortCodex is a helper function to abort requests with a specific message. -func abortCodex(c *gin.Context, message string) { - c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": message}) +// abortCodex is a helper function to abort requests with a specific status code. +func abortCodex(c *gin.Context, statusCode int) { + c.AbortWithStatusJSON(statusCode, gin.H{"error": "Request failed"}) } // GetEngine returns information about a specific engine.