fix: replace bare string raises with proper exception types (#22446)

`raise "string"` in Python raises TypeError instead of the intended
error, making error messages confusing and debugging difficult.

Co-authored-by: gambletan <ethanchang32@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alvin Tang
2026-03-08 16:39:09 -05:00
committed by GitHub
co-authored by gambletan Claude Opus 4.6
parent abe865f4f3
commit 2c35bdbcf5
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1747,7 +1747,7 @@ async def download_file_stream(
yield f"data: {json.dumps(res)}\n\n"
else:
raise "Ollama: Could not create blob, Please try again."
raise RuntimeError("Ollama: Could not create blob, Please try again.")
# url = "https://huggingface.co/TheBloke/stablelm-zephyr-3b-GGUF/resolve/main/stablelm-zephyr-3b.Q2_K.gguf"