MCPcopy
hub / github.com/pydata/xarray / add_path_context_to_errors

Function add_path_context_to_errors

xarray/core/datatree_mapping.py:142–148  ·  view source on GitHub ↗

Add path context to any errors.

(path: str)

Source from the content-addressed store, hash-verified

140
141@contextmanager
142def add_path_context_to_errors(path: str):
143 """Add path context to any errors."""
144 try:
145 yield
146 except Exception as e:
147 e.add_note(f"Raised whilst mapping function over node(s) with path {path!r}")
148 raise
149
150
151def _check_single_set_return_values(path_to_node: str, obj: Any) -> int | None:

Callers 3

_selective_indexingMethod · 0.90
merge_treesFunction · 0.90
map_over_datasetsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…