mirror of
https://github.com/Cian-H/simple_blender_server.git
synced 2025-12-22 13:31:57 +00:00
Fixed mistake in error handling code that causes silent errors
This commit is contained in:
4
main.go
4
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"`
|
||||
|
||||
Reference in New Issue
Block a user