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

Function taskPluginCompileError

controller/task_plugin.go:34–41  ·  view source on GitHub ↗
(c *gin.Context, err error)

Source from the content-addressed store, hash-verified

32const maxTaskPluginSourceBytes = 8 << 20
33
34func taskPluginCompileError(c *gin.Context, err error) {
35 var unknownField *jsplugin.UnknownMetaFieldError
36 if errors.As(err, &unknownField) {
37 common.ApiErrorT(c, "Plugin metadata contains an unknown field \"{{field}}\". If this plugin was downloaded from the official marketplace, it may require a newer version of new-api. Try updating new-api and installing the plugin again.", map[string]any{"field": unknownField.Field})
38 return
39 }
40 common.ApiError(c, err)
41}
42
43type taskPluginUploadRequest struct {
44 Source string `json:"source" binding:"required"`

Callers 5

UploadTaskPluginFunction · 0.85
GetTaskPluginFunction · 0.85
DryRunTaskPluginFunction · 0.85
ActivateTaskPluginFunction · 0.85

Calls 2

ApiErrorTFunction · 0.92
ApiErrorFunction · 0.92

Tested by

no test coverage detected