aboutsummaryrefslogtreecommitdiffstats
path: root/web/command/handler/upload.go
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-13 21:23:34 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-13 21:23:34 +0100
commit684787bcb72aece2aa914597a3bc8788432e66f7 (patch)
treea55fdcfc6f7f4d2f7ae86ba0a94e8d366f5c5cda /web/command/handler/upload.go
parentcdb75d3fcbc9339b897f8c6ff4d69a577f017393 (diff)
Add flags
Diffstat (limited to 'web/command/handler/upload.go')
-rw-r--r--web/command/handler/upload.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/command/handler/upload.go b/web/command/handler/upload.go
index 0e4928c..96bbef1 100644
--- a/web/command/handler/upload.go
+++ b/web/command/handler/upload.go
@@ -16,11 +16,11 @@ func GetUpload(index *index.SiteIndex) func(http.ResponseWriter, *http.Request)
return ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (Node, error) {
siteName := r.PathValue("site")
if siteName == "" {
- return nil, fmt.Errorf("unknown site")
+ return html.ErrorPage("Unknown site: " + siteName), nil
}
site := index.GetSite(siteName)
if site == nil {
- return nil, fmt.Errorf("unknown site")
+ return html.ErrorPage("Unknown site: " + siteName), nil
}
return html.UploadPage("", "", siteName), nil
@@ -31,7 +31,7 @@ func PostUpload(mainConfig *config.MainConfig, index *index.SiteIndex) func(http
return ghttp.Adapt(func(w http.ResponseWriter, r *http.Request) (Node, error) {
siteName := r.PathValue("site")
if siteName == "" {
- return nil, fmt.Errorf("unknown site")
+ return html.ErrorPage("Unknown site: " + siteName), nil
}
reader, err := r.MultipartReader()