MCPcopy Create free account
hub / github.com/QuantumNous/new-api / writeTaskMediaProxyError

Function writeTaskMediaProxyError

controller/video_proxy.go:558–572  ·  view source on GitHub ↗
(c *gin.Context, err error)

Source from the content-addressed store, hash-verified

556}
557
558func writeTaskMediaProxyError(c *gin.Context, err error) {
559 if c.Writer.Written() {
560 logger.LogError(c.Request.Context(), err.Error())
561 return
562 }
563 var proxyErr *taskMediaProxyError
564 if !errors.As(err, &proxyErr) {
565 proxyErr = &taskMediaProxyError{
566 status: http.StatusBadGateway, code: "artifact_upstream_error",
567 message: "Failed to fetch artifact content", err: err,
568 }
569 }
570 c.Header("Cache-Control", "private, no-store")
571 writeTaskArtifactError(c, proxyErr.status, proxyErr.code, proxyErr.message)
572}
573
574func writeVideoDataURL(c *gin.Context, dataURL string) error {
575 if len(dataURL) > taskMediaDataURLMaxEncodedBytes {

Callers 2

VideoProxyFunction · 0.85
TaskArtifactContentFunction · 0.85

Calls 4

LogErrorFunction · 0.92
writeTaskArtifactErrorFunction · 0.85
HeaderMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected