mirror of https://github.com/langgenius/dify.git
Merge 9123315289 into 508350ec6a
This commit is contained in:
commit
0a7703689a
|
|
@ -34,7 +34,7 @@ def reset_password(email, new_password, password_confirm):
|
|||
|
||||
try:
|
||||
valid_password(new_password)
|
||||
except:
|
||||
except Exception:
|
||||
click.echo(click.style(f"Invalid password. Must match {password_pattern}", fg="red"))
|
||||
return
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ def reset_email(email, new_email, email_confirm):
|
|||
|
||||
try:
|
||||
email_validate(normalized_new_email)
|
||||
except:
|
||||
except Exception:
|
||||
click.echo(click.style(f"Invalid email: {new_email}", fg="red"))
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CotAgentOutputParser:
|
|||
json_text = re.sub(r"^[a-zA-Z]+\n", "", block.strip(), flags=re.MULTILINE)
|
||||
json_blocks.append(json.loads(json_text, strict=False))
|
||||
return json_blocks
|
||||
except:
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
code_block_cache = ""
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class AnalyticdbVectorOpenAPI:
|
|||
try:
|
||||
from alibabacloud_gpdb20160503.client import Client # type: ignore
|
||||
from alibabacloud_tea_openapi import models as open_api_models # type: ignore
|
||||
except:
|
||||
except Exception:
|
||||
raise ImportError(_import_err_msg)
|
||||
self._collection_name = collection_name.lower()
|
||||
self.config = config
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class LindormVectorStore(BaseVector):
|
|||
params["routing"] = self._routing
|
||||
self._client.get(index=self._collection_name, id=id, params=params)
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Document]:
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class OpenSearchVector(BaseVector):
|
|||
try:
|
||||
self._client.get(index=self._collection_name.lower(), id=id)
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Document]:
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class AwsS3Storage(BaseStorage):
|
|||
try:
|
||||
self.client.head_object(Bucket=self.bucket_name, Key=filename)
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def delete(self, filename: str):
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class OracleOCIStorage(BaseStorage):
|
|||
try:
|
||||
self.client.head_object(Bucket=self.bucket_name, Key=filename)
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def delete(self, filename: str):
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ def check_csrf_token(request: Request, user_id: str):
|
|||
verified = {}
|
||||
try:
|
||||
verified = PassportService().verify(csrf_token)
|
||||
except:
|
||||
except Exception:
|
||||
_unauthorized()
|
||||
|
||||
if verified.get("sub") != user_id:
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ class AppService:
|
|||
if provider is None:
|
||||
raise ValueError(f"provider not found for tool {tool_name}")
|
||||
meta["tool_icons"][tool_name] = json.loads(provider.icon)
|
||||
except:
|
||||
except Exception:
|
||||
meta["tool_icons"][tool_name] = {"background": "#252525", "content": "\ud83d\ude01"}
|
||||
|
||||
return meta
|
||||
|
|
|
|||
|
|
@ -831,7 +831,7 @@ class WebhookService:
|
|||
response_data = {"message": response_body}
|
||||
else:
|
||||
response_data = {"status": "success", "message": "Webhook processed successfully"}
|
||||
except:
|
||||
except Exception:
|
||||
response_data = {"message": response_body or "Webhook processed successfully"}
|
||||
|
||||
return response_data, status_code
|
||||
|
|
|
|||
Loading…
Reference in New Issue