(c *gin.Context, payload any, err error)
| 88 | } |
| 89 | |
| 90 | func 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 | } |
no test coverage detected