fix: replace bare except with except Exception in core agent, storage and vector backends (#40801)

This commit is contained in:
Dream 2026-08-15 00:56:09 +00:00 committed by GitHub
parent dfac3e524e
commit 8031ea6d73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 8 additions and 8 deletions

View File

@ -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 = ""

View File

@ -86,7 +86,7 @@ class AwsS3Storage(BaseStorage):
try:
self.client.head_object(Bucket=self.bucket_name, Key=filename)
return True
except:
except Exception:
return False
@override

View File

@ -58,7 +58,7 @@ class OracleOCIStorage(BaseStorage):
try:
self.client.head_object(Bucket=self.bucket_name, Key=filename)
return True
except:
except Exception:
return False
@override

View File

@ -66,7 +66,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

View File

@ -248,7 +248,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
@override

View File

@ -191,7 +191,7 @@ class OpenSearchVector(BaseVector):
try:
self._client.get(index=self._collection_name.lower(), id=id)
return True
except:
except Exception:
return False
@override

View File

@ -20,7 +20,7 @@ class QuotaCharge:
try:
do_work()
charge.commit() # Confirm consumption
except:
except Exception:
charge.refund() # Release frozen quota
If neither commit() nor refund() is called, the billing system's

View File

@ -881,7 +881,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