Skip to content

Commit 86c32c1

Browse files
committed
minor rename
1 parent 4b25dcf commit 86c32c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/models-library/src/models_library/errors_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def _get_full_class_name(cls) -> str:
3131
]
3232
return ".".join(reversed(relevant_classes))
3333

34-
def ctx(self):
35-
"""Returns context stored in the exception"""
34+
def error_context(self):
35+
"""Returns context in which error occurred and stored within the exception"""
3636
return dict(**self.__dict__)

packages/models-library/tests/test_errors_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class MyError(OsparcErrorMixin, ValueError):
155155
msg_template = "{value} and {missing}"
156156

157157
exc = MyError(value=42, missing="foo", extra="bar")
158-
assert exc.ctx() == {"value": 42, "missing": "foo", "extra": "bar"}
158+
assert exc.error_context() == {"value": 42, "missing": "foo", "extra": "bar"}
159159

160160
exc = MyError(value=42)
161-
assert exc.ctx() == {"value": 42}
161+
assert exc.error_context() == {"value": 42}

0 commit comments

Comments
 (0)