mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-22 07:31:05 +08:00
Feat: add built in DSL file API (#17003)
### Summary 1. list and get by id API for builtin DSL 2. add DSL default component param values validation 3. remove all hard code keys for parser config
This commit is contained in:
@@ -17,9 +17,11 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"ragflow/internal/common"
|
||||
"ragflow/internal/service"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
@@ -66,3 +68,20 @@ func HandleNoRoute(c *gin.Context) {
|
||||
"error": "Not Found",
|
||||
})
|
||||
}
|
||||
|
||||
// IngestionTaskErrorCode maps ingestion-task service errors to common.ErrorCode
|
||||
// for HTTP responses.
|
||||
func IngestionTaskErrorCode(err error) common.ErrorCode {
|
||||
var transitionErr *service.InvalidTaskTransitionError
|
||||
if errors.As(err, &transitionErr) {
|
||||
return common.CodeConflict
|
||||
}
|
||||
var conflictErr *service.TaskStatusConflictError
|
||||
if errors.As(err, &conflictErr) {
|
||||
return common.CodeConflict
|
||||
}
|
||||
if errors.Is(err, common.ErrTaskNotFound) {
|
||||
return common.CodeNotFound
|
||||
}
|
||||
return common.CodeExceptionError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user