Throw error if empty files
This commit is contained in:
parent
2cef055ff2
commit
7147f477e2
|
@ -202,6 +202,13 @@ func postServerCompressFiles(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if len(data.Files) == 0 {
|
||||
c.AbortWithStatusJSON(http.StatusUnprocessableEntity, gin.H{
|
||||
"error": "No files were passed through to be compressed.",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if !s.Filesystem.HasSpaceAvailable() {
|
||||
c.AbortWithStatusJSON(http.StatusConflict, gin.H{
|
||||
"error": "This server does not have enough available disk space to generate a compressed archive.",
|
||||
|
|
Loading…
Reference in New Issue
Block a user