fix: replace bare except with except Exception (#22473)
Replace bare except clauses with except Exception to follow Python best practices and avoid catching unexpected system exceptions like KeyboardInterrupt and SystemExit.
This commit is contained in:
@@ -1095,7 +1095,7 @@ async def send_chat_message_event_by_id(
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ async def set_tool_servers_config(
|
||||
|
||||
try:
|
||||
request.app.state.oauth_client_manager.remove_client(client_key)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Set new tool server connections
|
||||
|
||||
@@ -70,7 +70,7 @@ async def process_pipeline_inlet_filter(request, payload, user, models):
|
||||
|
||||
try:
|
||||
urlIdx = int(urlIdx)
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
url = request.app.state.config.OPENAI_API_BASE_URLS[urlIdx]
|
||||
@@ -123,7 +123,7 @@ async def process_pipeline_outlet_filter(request, payload, user, models):
|
||||
|
||||
try:
|
||||
urlIdx = int(urlIdx)
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
url = request.app.state.config.OPENAI_API_BASE_URLS[urlIdx]
|
||||
|
||||
@@ -1688,7 +1688,7 @@ def process_file(
|
||||
VECTOR_DB_CLIENT.delete_collection(
|
||||
collection_name=f"file-{file.id}"
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
# Audio file upload pipeline
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user