From 830ee9bdbc95d3d0869805cac826051a4f4e3212 Mon Sep 17 00:00:00 2001 From: Robert Janetzko Date: Thu, 18 Aug 2022 08:23:17 +0000 Subject: [PATCH] catch error in file chooser --- backend/.vscode/launch.json | 15 +++++++++++++++ backend/server/loading.go | 4 ++++ legendsbrowser.code-workspace | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 backend/.vscode/launch.json diff --git a/backend/.vscode/launch.json b/backend/.vscode/launch.json new file mode 100644 index 0000000..6deb9a6 --- /dev/null +++ b/backend/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Package", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "main.go" + } + ] +} \ No newline at end of file diff --git a/backend/server/loading.go b/backend/server/loading.go index b325e1c..a217221 100644 --- a/backend/server/loading.go +++ b/backend/server/loading.go @@ -107,6 +107,10 @@ func (h loadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } } + if err != nil { + httpError(w, err) + return + } http.Redirect(w, r, h.server.context.config.SubUri+"/load", http.StatusSeeOther) } diff --git a/legendsbrowser.code-workspace b/legendsbrowser.code-workspace index 5a14aa1..376cddd 100644 --- a/legendsbrowser.code-workspace +++ b/legendsbrowser.code-workspace @@ -16,5 +16,9 @@ "jinliming2.vscode-go-template", "golang.go" ] + }, + "launch": { + "version": "0.2.0", + "configurations": [] } } \ No newline at end of file