From d34a996c3c774f8de5ad6cc477409c73aedc4bb3 Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Wed, 21 May 2025 14:11:36 +0100 Subject: [PATCH] Fixed mistake in error handling code that causes silent errors --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index b36f17d..e2473bd 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "bytes" "encoding/json" + "errors" "fmt" "io" "log" @@ -100,6 +101,9 @@ func handleCreateModel(w http.ResponseWriter, r *http.Request) { blenderOutput := string(output) if err != nil || strings.Contains(blenderOutput, "Traceback") || strings.Contains(blenderOutput, "Error:") { log.Printf("Command execution failed: %v, Output: %s", err, blenderOutput) + if err == nil { + err = errors.New("Python error") + } errorResponse := struct { Error string `json:"error"` BlenderLog string `json:"blender_log"`