-
Notifications
You must be signed in to change notification settings - Fork 180
/
errors.go
33 lines (26 loc) · 1.29 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package nodes
import "github.com/pydio/cells/v4/common/service/errors"
// ErrFileNotFound returns a 404 error
func ErrFileNotFound(format string, a ...interface{}) error {
return errors.NotFound("file.not.found", format, a...)
}
// ErrBranchInfoMissing returns a 500 error
func ErrBranchInfoMissing(identifier string) error {
return errors.InternalServerError("branch.info.incomplete", "Cannot find client for branch %s - did you forget to insert a middleware?", identifier)
}
// ErrBranchInfoRootMissing returns a 500 error
func ErrBranchInfoRootMissing(identifier string) error {
return errors.InternalServerError("branch.info.incomplete", "Cannot find Root in branch %s - did you forget to insert a middleware?", identifier)
}
// ErrCannotReadStore returns a 403 error
func ErrCannotReadStore(store string) error {
return errors.Forbidden("forbidden.store", "You are not allowed to access store %s", store)
}
// ErrCannotWriteStore returns a 403 error
func ErrCannotWriteStore(store string) error {
return errors.Forbidden("forbidden.store", "You are not allowed to write to store %s", store)
}
// ErrCannotFindACL returns a 500 error
func ErrCannotFindACL() error {
return errors.InternalServerError("branch.info.incomplete", "Cannot load ACLs in branch - did you forget to insert a middleware?")
}