Improve HTTP error for unknown permissions.
This commit is contained in:
1 parent
75d6d87c23
commit
a73c42ce08
2 files changed
+7
-2
No files matched your search
@@ -124,6 +124,10 @@ func httpError(w http.ResponseWriter, err error) {
|
||||
notFound(w)
|
||||
return
|
||||
}
|
||||
if errors.Is(err, group.ErrUnknownPermission) {
|
||||
http.Error(w, "unknown permission", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
var autherr *group.NotAuthorisedError
|
||||
if errors.As(err, &autherr) {
|
||||
log.Printf("HTTP server error: %v", err)
|
||||
|
||||
Reference in new issue
Block a user