Browse Source

fix error msg format issue (#2715)

Co-authored-by: jyong <jyong@dify.ai>
tags/0.5.9
Jyong 1 year ago
parent
commit
7f3dec7bee
No account linked to committer's email address

+ 1
- 1
api/core/model_runtime/model_providers/baichuan/text_embedding/text_embedding.py View File

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:

+ 1
- 1
api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py View File

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:

+ 1
- 1
api/core/model_runtime/model_providers/localai/text_embedding/text_embedding.py View File

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:

+ 1
- 1
api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py View File

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)

+ 1
- 1
api/core/model_runtime/model_providers/openllm/text_embedding/text_embedding.py View File

# 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:

Loading…
Cancel
Save