Kaynağa Gözat

fix: preserve original error message in webui error display (#1204)

build_html_error_message() replaced non-Exception errors (e.g. strings)
with a generic "Unknown error" message. This caused actual error details
to be lost when the inference engine returned string error messages.

Made-with: Cursor
huang yutong 2 hafta önce
ebeveyn
işleme
a0b7fe2e70
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      tools/webui/inference.py

+ 2 - 2
tools/webui/inference.py

@@ -68,12 +68,12 @@ def get_reference_audio(reference_audio: str, reference_text: str) -> list:
 
 def build_html_error_message(error: Any) -> str:
 
-    error = error if isinstance(error, Exception) else Exception("Unknown error")
+    error_str = str(error) if error is not None else "Unknown error"
 
     return f"""
     <div style="color: red; 
     font-weight: bold;">
-        {html.escape(str(error))}
+        {html.escape(error_str)}
     </div>
     """