more updates

This commit is contained in:
Henrique Dias committed 2017-06-19 18:23:57 +01:00
1 parent af4aaf07df
commit 8c19eda25f
16 files changed
+79 -83

No files matched your search

-24
View File
@@ -1,24 +0,0 @@
package filemanager
import (
"net/http"
"os"
)
// errorToHTTPCode converts errors to HTTP Status Code.
func errorToHTTPCode(err error, gone bool) int {
switch {
case os.IsPermission(err):
return http.StatusForbidden
case os.IsNotExist(err):
if !gone {
return http.StatusNotFound
}
return http.StatusGone
case os.IsExist(err):
return http.StatusGone
default:
return http.StatusInternalServerError
}
}