fix error response code
This commit is contained in:
@@ -76,6 +76,9 @@ func processRequest(c *gin.Context, upstream *OPENAI_UPSTREAM, record *Record, s
|
||||
if !haveResponse {
|
||||
log.Println("Timeout upstream", upstream.Endpoint)
|
||||
errCtx = errors.New("timeout")
|
||||
if shouldResponse {
|
||||
c.AbortWithError(502, errCtx)
|
||||
}
|
||||
cancel()
|
||||
}
|
||||
}()
|
||||
@@ -130,8 +133,6 @@ func processRequest(c *gin.Context, upstream *OPENAI_UPSTREAM, record *Record, s
|
||||
haveResponse = true
|
||||
log.Println("Error", err, upstream.SK, upstream.Endpoint)
|
||||
|
||||
log.Println("debug", r)
|
||||
|
||||
errCtx = err
|
||||
|
||||
// abort to error handle
|
||||
|
||||
Reference in New Issue
Block a user