Skip to content

Commit 5df3158

Browse files
Coerce empty-string cause category to None (0068)
`_build_cause_chain` recorded an empty-string `category` verbatim, but `CauseLink.category` is documented as a non-empty string or None and `_derive_cause` already treats an empty string as no-category. Coerce it to None so the chain representation matches. No exception carries an empty-string category in practice; addresses PR review feedback.
1 parent 3685329 commit 5df3158

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/openarmature/graph/middleware/failure_isolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _build_cause_chain(exc: Exception) -> tuple[CauseLink, ...]:
8787
category = getattr(current, "category", None)
8888
links.append(
8989
CauseLink(
90-
category=category if isinstance(category, str) else None,
90+
category=category if isinstance(category, str) and category else None,
9191
message=str(current),
9292
carrier=isinstance(current, NodeException),
9393
)

0 commit comments

Comments
 (0)