MCPcopy Create free account
hub / github.com/ShukeBta/MediaStationGo / writeFileManagerResponse

Function writeFileManagerResponse

internal/handler/filemanager.go:90–100  ·  view source on GitHub ↗
(c *gin.Context, payload any, err error)

Source from the content-addressed store, hash-verified

88}
89
90func writeFileManagerResponse(c *gin.Context, payload any, err error) {
91 if err != nil {
92 if errors.Is(err, service.ErrPathOutOfBounds) || errors.Is(err, service.ErrRootMutation) {
93 c.JSON(http.StatusForbidden, gin.H{"error": err.Error()})
94 return
95 }
96 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
97 return
98 }
99 c.JSON(http.StatusOK, payload)
100}

Callers 5

browseFilesHandlerFunction · 0.85
createFolderHandlerFunction · 0.85
renameFileHandlerFunction · 0.85
deleteFileHandlerFunction · 0.85
transferFileHandlerFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected