sync: Report custom errors

This commit is contained in:
nemunaire 2022-07-11 19:57:33 +02:00
commit c78545c18b
17 changed files with 510 additions and 137 deletions

View file

@ -0,0 +1,17 @@
package main
import (
"fmt"
"path"
"srs.epita.fr/fic-server/libfic"
)
func EPITACheckFile(file *fic.EFile) (errs []error) {
// Enforce file format
if path.Ext(file.Name) == "rar" || path.Ext(file.Name) == "7z" {
errs = append(errs, fmt.Errorf("this file use a forbidden archive type."))
}
return
}