fix #263: add exception handling for /continue command in stapp#275
Open
Kailigithub wants to merge 1 commit into
Open
fix #263: add exception handling for /continue command in stapp#275Kailigithub wants to merge 1 commit into
Kailigithub wants to merge 1 commit into
Conversation
Contributor
Author
问题描述Issue #263: 修复方案在
此改动仅增加容错逻辑,不改变正常流程行为。 验证
关联修复 #263 |
a38d2ef to
f05d9a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
Issue #263:
/continue指令恢复会话时,如果handle_frontend_command或extract_ui_messages抛出异常(例如会话文件损坏、后端状态异常等),整个 Streamlit 应用会直接崩溃,用户只能重启。修复方案
在
frontends/stapp.py的/continue命令处理流程外层包裹try/except块:Exception异常st.error()显示友好的中文错误提示「恢复会话失败: {异常信息}」st.rerun()重新渲染界面,而非直接崩溃此改动仅增加容错逻辑,不改变正常流程行为。
验证
python3 -m py_compile frontends/stapp.py✓ruff check frontends/stapp.py✓(仅有文件头部预存风格问题,与本次修改无关)/continue分支关联
修复 #263