mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add CellError to explain when a formula refers to a cell with an error value
Summary: get_cell_value wraps RaisedException with CellError to expand the error message for the user. This is still pretty conceptual, the comments explain some things to think about, but it works and is an improvement. Test Plan: Updated Python unit tests Reviewers: dsagal, paulfitz Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2928
This commit is contained in:
@@ -147,7 +147,12 @@ class BaseColumn(object):
|
||||
"""
|
||||
raw = self.raw_get(row_id)
|
||||
if isinstance(raw, objtypes.RaisedException):
|
||||
raise raw.error
|
||||
if isinstance(raw.error, depend.CircularRefError):
|
||||
# Wrapping a CircularRefError in a CellError is often redundant, but
|
||||
# TODO a CellError is still useful if the calling cell is not involved in the cycle
|
||||
raise raw.error
|
||||
else:
|
||||
raise objtypes.CellError(self.table_id, self.col_id, row_id, raw.error)
|
||||
if self.type_obj.is_right_type(raw):
|
||||
return self._make_rich_value(raw)
|
||||
return usertypes.AltText(str(raw), self.type_obj.typename())
|
||||
|
||||
Reference in New Issue
Block a user