[PR #22407] [CLOSED] fix: replace bare except clauses with except Exception #113975

Closed
opened 2026-05-18 14:33:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22407
Author: @gambletan
Created: 3/8/2026
Status: Closed

Base: mainHead: fix/bare-except-clauses


📝 Commits (1)

  • 5b69043 fix: replace bare except clauses with except Exception

📊 Changes

11 files changed (+17 additions, -17 deletions)

View changed files

📝 backend/open_webui/main.py (+2 -2)
📝 backend/open_webui/retrieval/loaders/external_document.py (+1 -1)
📝 backend/open_webui/retrieval/loaders/mineru.py (+3 -3)
📝 backend/open_webui/retrieval/vector/dbs/chroma.py (+1 -1)
📝 backend/open_webui/routers/chats.py (+1 -1)
📝 backend/open_webui/routers/configs.py (+1 -1)
📝 backend/open_webui/routers/pipelines.py (+2 -2)
📝 backend/open_webui/routers/retrieval.py (+1 -1)
📝 backend/open_webui/socket/main.py (+1 -1)
📝 backend/open_webui/utils/middleware.py (+3 -3)
📝 backend/open_webui/utils/oauth.py (+1 -1)

📄 Description

Summary

  • Replace all bare except: clauses with except Exception: across the backend codebase
  • Bare except: catches BaseException, including SystemExit and KeyboardInterrupt, which prevents clean shutdown and Ctrl+C signal handling
  • This change ensures system signals propagate correctly while still catching all actual errors

Files Changed

  • backend/open_webui/main.py
  • backend/open_webui/socket/main.py
  • backend/open_webui/utils/middleware.py
  • backend/open_webui/utils/oauth.py
  • backend/open_webui/routers/configs.py
  • backend/open_webui/routers/retrieval.py
  • backend/open_webui/routers/chats.py
  • backend/open_webui/routers/pipelines.py
  • backend/open_webui/retrieval/vector/dbs/chroma.py
  • backend/open_webui/retrieval/loaders/mineru.py
  • backend/open_webui/retrieval/loaders/external_document.py

Test plan

  • Verify existing tests pass
  • Verify Ctrl+C cleanly shuts down the server
  • Verify error handling behavior is unchanged for actual exceptions

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22407 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/bare-except-clauses` --- ### 📝 Commits (1) - [`5b69043`](https://github.com/open-webui/open-webui/commit/5b69043afba8fb83980ab1ede4dfa5b60a0845d8) fix: replace bare except clauses with except Exception ### 📊 Changes **11 files changed** (+17 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+2 -2) 📝 `backend/open_webui/retrieval/loaders/external_document.py` (+1 -1) 📝 `backend/open_webui/retrieval/loaders/mineru.py` (+3 -3) 📝 `backend/open_webui/retrieval/vector/dbs/chroma.py` (+1 -1) 📝 `backend/open_webui/routers/chats.py` (+1 -1) 📝 `backend/open_webui/routers/configs.py` (+1 -1) 📝 `backend/open_webui/routers/pipelines.py` (+2 -2) 📝 `backend/open_webui/routers/retrieval.py` (+1 -1) 📝 `backend/open_webui/socket/main.py` (+1 -1) 📝 `backend/open_webui/utils/middleware.py` (+3 -3) 📝 `backend/open_webui/utils/oauth.py` (+1 -1) </details> ### 📄 Description ## Summary - Replace all bare `except:` clauses with `except Exception:` across the backend codebase - Bare `except:` catches `BaseException`, including `SystemExit` and `KeyboardInterrupt`, which prevents clean shutdown and Ctrl+C signal handling - This change ensures system signals propagate correctly while still catching all actual errors ## Files Changed - `backend/open_webui/main.py` - `backend/open_webui/socket/main.py` - `backend/open_webui/utils/middleware.py` - `backend/open_webui/utils/oauth.py` - `backend/open_webui/routers/configs.py` - `backend/open_webui/routers/retrieval.py` - `backend/open_webui/routers/chats.py` - `backend/open_webui/routers/pipelines.py` - `backend/open_webui/retrieval/vector/dbs/chroma.py` - `backend/open_webui/retrieval/loaders/mineru.py` - `backend/open_webui/retrieval/loaders/external_document.py` ## Test plan - [ ] Verify existing tests pass - [ ] Verify Ctrl+C cleanly shuts down the server - [ ] Verify error handling behavior is unchanged for actual exceptions 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-18 14:33:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#113975