mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-04 06:35:10 +08:00
fix: add exception handling for get_by_id method (#6861)
### What problem does this PR solve? Fixes #6548 Add exception handling to prevent exceptions from propagating back to the web, which may lead to failure in displaying conversation content. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): Co-authored-by: cm <caiming@sict.ac.cn>
This commit is contained in:
parent
a1fb32908d
commit
a20439bf81
@ -225,9 +225,12 @@ class CommonService:
|
|||||||
# pid: Record ID
|
# pid: Record ID
|
||||||
# Returns:
|
# Returns:
|
||||||
# Tuple of (success, record)
|
# Tuple of (success, record)
|
||||||
obj = cls.model.get_or_none(cls.model.id == pid)
|
try:
|
||||||
if obj:
|
obj = cls.model.get_or_none(cls.model.id == pid)
|
||||||
return True, obj
|
if obj:
|
||||||
|
return True, obj
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
return False, None
|
return False, None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user