Unverified Commit 7f3dec7b authored by Jyong's avatar Jyong Committed by GitHub

fix error msg format issue (#2715)

Co-authored-by: 's avatarjyong <jyong@dify.ai>
parent b1e0db49
...@@ -108,7 +108,7 @@ class BaichuanTextEmbeddingModel(TextEmbeddingModel): ...@@ -108,7 +108,7 @@ class BaichuanTextEmbeddingModel(TextEmbeddingModel):
try: try:
response = post(url, headers=headers, data=dumps(data)) response = post(url, headers=headers, data=dumps(data))
except Exception as e: except Exception as e:
raise InvokeConnectionError(e) raise InvokeConnectionError(str(e))
if response.status_code != 200: if response.status_code != 200:
try: try:
......
...@@ -57,7 +57,7 @@ class JinaTextEmbeddingModel(TextEmbeddingModel): ...@@ -57,7 +57,7 @@ class JinaTextEmbeddingModel(TextEmbeddingModel):
try: try:
response = post(url, headers=headers, data=dumps(data)) response = post(url, headers=headers, data=dumps(data))
except Exception as e: except Exception as e:
raise InvokeConnectionError(e) raise InvokeConnectionError(str(e))
if response.status_code != 200: if response.status_code != 200:
try: try:
......
...@@ -59,7 +59,7 @@ class LocalAITextEmbeddingModel(TextEmbeddingModel): ...@@ -59,7 +59,7 @@ class LocalAITextEmbeddingModel(TextEmbeddingModel):
try: try:
response = post(join(url, 'embeddings'), headers=headers, data=dumps(data), timeout=10) response = post(join(url, 'embeddings'), headers=headers, data=dumps(data), timeout=10)
except Exception as e: except Exception as e:
raise InvokeConnectionError(e) raise InvokeConnectionError(str(e))
if response.status_code != 200: if response.status_code != 200:
try: try:
......
...@@ -65,7 +65,7 @@ class MinimaxTextEmbeddingModel(TextEmbeddingModel): ...@@ -65,7 +65,7 @@ class MinimaxTextEmbeddingModel(TextEmbeddingModel):
try: try:
response = post(url, headers=headers, data=dumps(data)) response = post(url, headers=headers, data=dumps(data))
except Exception as e: except Exception as e:
raise InvokeConnectionError(e) raise InvokeConnectionError(str(e))
if response.status_code != 200: if response.status_code != 200:
raise InvokeServerUnavailableError(response.text) raise InvokeServerUnavailableError(response.text)
......
...@@ -53,7 +53,7 @@ class OpenLLMTextEmbeddingModel(TextEmbeddingModel): ...@@ -53,7 +53,7 @@ class OpenLLMTextEmbeddingModel(TextEmbeddingModel):
# cloud not connect to the server # cloud not connect to the server
raise InvokeAuthorizationError(f"Invalid server URL: {e}") raise InvokeAuthorizationError(f"Invalid server URL: {e}")
except Exception as e: except Exception as e:
raise InvokeConnectionError(e) raise InvokeConnectionError(str(e))
if response.status_code != 200: if response.status_code != 200:
if response.status_code == 400: if response.status_code == 400:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment